async function RestQuery({
  method,
  config,
  auth,
  className,
  restWhere = {},
  restOptions = {},
  clientSDK,
  runAfterFind = true,
  runBeforeFind = true,
  context,
}) {
  if (![RestQuery.Method.find, RestQuery.Method.get].includes(method)) {
    throw new Parse.Error(Parse.Error.INVALID_QUERY, 'bad query type');
  }
  enforceRoleSecurity(method, className, auth);
  const result = runBeforeFind
    ? await triggers.maybeRunQueryTrigger(
      triggers.Types.beforeFind,
      className,
      restWhere,
      restOptions,
      config,
      auth,
      context,
      method === RestQuery.Method.get
    )
    : Promise.resolve({ restWhere, restOptions });

  return new _UnsafeRestQuery(
    config,
    auth,
    className,
    result.restWhere || restWhere,
    result.restOptions || restOptions,
    clientSDK,
    runAfterFind,
    context
  );
}
Use to perform a query on a class. It will run security checks and triggers.
@param options
@param options.method {RestQuery.Method} The type of query to perform
@param options.config {ParseServerConfiguration} The server configuration
@param options.auth {Auth} The auth object for the request
@param options.className {string} The name of the class to query
@param options.restWhere {object} The where object for the query
@param options.restOptions {object} The options object for the query
@param options.clientSDK {string} The client SDK that is performing the query
@param options.runAfterFind {boolean} Whether to run the afterFind trigger
@param options.runBeforeFind {boolean} Whether to run the beforeFind trigger
@param options.context {object} The context object for the query
@returns {Promise<_UnsafeRestQuery>} A promise that is resolved with the _UnsafeRestQuery object