src/query.js
function(objectId, options) {
        if (!objectId) {
          var errorObject = new AVError(
            AVError.OBJECT_NOT_FOUND,
            'Object not found.'
          );
          throw errorObject;
        }

        var obj = this._newObject();
        obj.id = objectId;

        var queryJSON = this.toJSON();
        var fetchOptions = {};

        if (queryJSON.keys) fetchOptions.keys = queryJSON.keys;
        if (queryJSON.include) fetchOptions.include = queryJSON.include;
        if (queryJSON.includeACL)
          fetchOptions.includeACL = queryJSON.includeACL;

        return _request(
          'classes',
          this.className,
          objectId,
          'GET',
          transformFetchOptions(fetchOptions),
          options
        ).then(response => {
          if (_.isEmpty(response))
            throw new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
          obj._finishFetch(obj.parse(response), true);
          return obj;
        });
      }
function(objectId, options) {
        if (!objectId) {
          var errorObject = new AVError(
            AVError.OBJECT_NOT_FOUND,
            'Object not found.'
          );
          throw errorObject;
        }

        var obj = this._newObject();
        obj.id = objectId;

        var queryJSON = this.toJSON();
        var fetchOptions = {};

        if (queryJSON.keys) fetchOptions.keys = queryJSON.keys;
        if (queryJSON.include) fetchOptions.include = queryJSON.include;
        if (queryJSON.includeACL)
          fetchOptions.includeACL = queryJSON.includeACL;

        return _request(
          'classes',
          this.className,
          objectId,
          'GET',
          transformFetchOptions(fetchOptions),
          options
        ).then(response => {
          if (_.isEmpty(response))
            throw new AVError(AVError.OBJECT_NOT_FOUND, 'Object not found.');
          obj._finishFetch(obj.parse(response), true);
          return obj;
        });
      }
function ( objectId , options ) { if ( ! objectId ) { var errorObject = new AVError ( AVError . OBJECT_NOT_FOUND , 'Object not found.' ) ; throw errorObject ; } var obj = this . _newObject ( ) ; obj . id = objectId ; var queryJSON = this . toJSON ( ) ; var fetchOptions = { } ; if ( queryJSON . keys ) fetchOptions . keys = queryJSON . keys ; if ( queryJSON . include ) fetchOptions . include = queryJSON . include ; if ( queryJSON . includeACL ) fetchOptions . includeACL = queryJSON . includeACL ; return _request ( 'classes' , this . className , objectId , 'GET' , transformFetchOptions ( fetchOptions ) , options ) . then ( response => { if ( _ . isEmpty ( response ) ) throw new AVError ( AVError . OBJECT_NOT_FOUND , 'Object not found.' ) ; obj . _finishFetch ( obj . parse ( response ) , true ) ; return obj ; } ) ; }
Constructs an AV.Object whose id is already known by fetching data from
the server.

@param {String} objectId The id of the object to be fetched.
@param {AuthOptions} options
@return {Promise.<AV.Object>}
Constructs an AV . Object whose id is already known by fetching data from the server .