constructor(schema, db, state, withMutations, batchToken) {
        this.schema = schema;
        this.db = db;
        this.state = state || db.getEmptyState();
        this.initialState = this.state;

        this.withMutations = Boolean(withMutations);
        this.batchToken = batchToken || getBatchToken();

        this.modelData = {};

        this.models = schema.getModelClasses();

        this.sessionBoundModels = this.models.map((modelClass) => {
            function SessionBoundModel() {
                return Reflect.construct(
                    modelClass,
                    arguments,
                    SessionBoundModel
                ); // eslint-disable-line prefer-rest-params
            }
            Reflect.setPrototypeOf(
                SessionBoundModel.prototype,
                modelClass.prototype
            );
            Reflect.setPrototypeOf(SessionBoundModel, modelClass);

            Object.defineProperty(this, modelClass.modelName, {
                get: () => SessionBoundModel,
            });

            SessionBoundModel.connect(this);
            return SessionBoundModel;
        });
    }
Creates a new Session.

@param  {Database} db - a {@link Database} instance
@param  {Object} state - the database state
@param  {Boolean} [withMutations] - whether the session should mutate data
@param  {Object} [batchToken] - used by the backend to identify objects that can be
                                mutated.