__reduceToQueryInformation__(composerArray) {

    let joins = {};

    let commands = composerArray.reduce((p, c) => {

      let composerCommand = c._command || {type: 'where', data: {comparisons: []}};

      if (composerCommand.type === 'join') {

        let joinName = composerCommand.data.name;
        let joinData = composerCommand.data.joinData.slice();
        joins[joinName] = {data: this.__addShortAliasToJoinData__(joinData.pop())};
        while (joinData.length) {
          let data = this.__addShortAliasToJoinData__(joinData.pop());
          joins[data.joinAlias] = joins[data.joinAlias] || {data: data};
          joins[joinName].prev = data.joinAlias;
          joinName = data.joinAlias;
        }

        return p;

      }

      let lastCommand = p[p.length - 1];
      let command = {
        where: null,
        limit: null,
        orderBy: [],
        groupBy: [],
        aggregate: []
      };
      p.push(command);

      if (
        lastCommand && (
          !lastCommand[composerCommand.type] ||
          lastCommand[composerCommand.type] instanceof Array
        )
      ) {

        command = lastCommand;
        p.pop();

      }

      if (command[composerCommand.type] instanceof Array) {

        command[composerCommand.type].push(
          Object.keys(composerCommand.data).reduce((p, c) => {
            return (p[c] = composerCommand.data[c], p);
          }, {})
        );

      } else {

        command[composerCommand.type] = Object.keys(composerCommand.data).reduce((p, c) => {
          return (p[c] = composerCommand.data[c], p);
        }, {});

      }

      return p;

    }, []);

    joins = Object.keys(joins).map(joinName => {
      let list = [];
      while (joinName) {
        list.unshift(joins[joinName].data);
        joinName = joins[joinName].prev;
      }
      return list;
    });

    return {
      commands: commands,
      joins: joins
    }

  }
Reduces an array of composer queries to a single query information object
@param {Array} [composerArray]
@return {Object} Looks like {commands: [], joins: []}
@private