Ash.Engine.Request.new

You're seeing just the function new, go back to Ash.Engine.Request module for more information.

Creates a new request.

The field values may be explicit values, or they may be instances of UnresolvedField.

When other requests depend on a value from this request, they will not be sent unless this request has completed its authorization (or this request has been configured not to do authorization). This allows requests to depend on eachother without those requests happening just before a request fails with a forbidden error. These fields are data, query, changeset and authorized?.

A field may not be resolved if the data of a request has been resolved and no other requests depend on that field.

Options:

  • query - The query to be used to fetch data. Used to authorize reads.
  • data - The ultimate goal of a request is to compute the data
  • resource - The primary resource of the request. Used for openeing transactions on creates/updates/destroys
  • changeset - Any changes to be made to the resource. Used to authorize writes.
  • path - The path of the request. This serves as a unique id, and is the way that other requests can refer to this one
  • action_type - The action_type of the request
  • action - The action being performed on the data
  • async? - Whether or not the request can be asynchronous, defaults to true.
  • api - The api module being called
  • name - A human readable name for the request, used when logging/in errors
  • strict_check_only? - If true, authorization will not be allowed to proceed to a runtime check (so it cannot run db queries unless authorization is assured)
  • actor - The actor performing the action, used for authorization
  • authorize? - Wether or not to perform authorization (defaults to true)
  • verbose? - print informational logs (warning, this will be a whole lot of logs)
  • write_to_data? - If set to false, this value is not returned from the initial call to the engine