code: function Query(state, entity) {
          /**
           * Primary key ids to filter records by. It is used for filtering records
           * direct key lookup when a user is trying to fetch records by its
           * primary key.
           *
           * It should not be used if there is a logic which prevents index usage, for
           * example, an "or" condition which already requires a full scan of records.
           */
          this.idFilter = null;
          /**
           * Whether to use `idFilter` key lookup. True if there is a logic which
           * prevents index usage, for example, an "or" condition which already
           * requires full scan.
           */
          this.cancelIdFilter = false;
          /**
           * Primary key ids to filter joined records. It is used for filtering
           * records direct key lookup. It should not be cancelled, because it
           * is free from the effects of normal where methods.
           */
          this.joinedIdFilter = null;
          /**
           * The where constraints for the query.
           */
          this.wheres = [];
          /**
           * The has constraints for the query.
           */
          this.have = [];
          /**
           * The orders of the query result.
           */
          this.orders = [];
          /**
           * Number of results to skip.
           */
          this.offsetNumber = 0;
          /**
           * Maximum number of records to return.
           *
           * We use polyfill of `Number.MAX_SAFE_INTEGER` for IE11 here.
           */
          this.limitNumber = Math.pow(2, 53) - 1;
          /**
           * The relationships that should be eager loaded with the result.
           */
          this.load = {};
          this.rootState = state;
          this.state = state[entity];
          this.entity = entity;
          this.model = this.getModel(entity);
          this.module = this.getModule(entity);
          this.hook = new Hook(this);
      }
docs: Create a new Query instance.