Cqrs.Absinthe.derive_mutation
derive_mutation
, go back to Cqrs.Absinthe module for more information.
Defines an Absinthe
mutation
for a Command.
Options
:as
- The name to use for the mutation. Defaults to the query_module name snake_cased.:then
- Afunction/1
that accepts the result of the command execution. The function should return the standardAbsinthe
{:ok, response}
or{:error, error}
tuple.:input_object?
-true | false
. Defaults tofalse
- If
true
, one arg with the name of:input
will be generated. - If
true
, aninput_object
for the Command is expected to exist. Seederive_mutation_input/2
.
- If
:arg_types
- A list of filter names to absinthe types. See example.:before_resolve
- Absinthe Middleware to run before the resolver.:after_resolve
- Absinthe Middleware to run after the resolver.:parent_mappings
- A keyword list of command fields to functions that receive the field's parent object as an argument.:field_transforms
- A keyword list of command fields to functions that receive the field's current value as an argument.:required
- A list of command fields to make required; regardless of how they are defined in the command module.