Ash.Api.get
get
, go back to Ash.Api module for more information.
Specs
get(resource :: Ash.Resource.t(), id_or_filter :: term(), params :: Keyword.t()) :: {:ok, Ash.Resource.record()} | {:error, term()}
Get a record by a primary key.
For a resource with a composite primary key, pass a keyword list, e.g
MyApi.get(MyResource, first_key: 1, second_key: 2)
:load
- Fields or relationships to load in the query. SeeAsh.Query.load/2
:tenant
- The tenant to set on the query being run:context
- Context to be set on the query being run:verbose?
- Log engine operations (very verbose!) The default value isfalse
.:action
- The action to use, either an Action struct or the name of the action:authorize?
- If an actor option is provided (even if it isnil
), authorization happens automatically. If not, this flag can be used to authorize with no user.:stacktraces?
- For Ash errors, can be set to true to get a stacktrace for each error that occured. See the error_handling guide for more. The default value isfalse
.:actor
- If an actor is provided, it will be used in conjunction with the authorizers of a resource to authorize access