Cqrs.Absinthe.derive_mutation

You're seeing just the macro derive_mutation, go back to Cqrs.Absinthe module for more information.
Link to this macro

derive_mutation(command_module, return_type, opts \\ [])

View Source (macro)

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 - A function/1 that accepts the result of the command execution. The function should return the standard Absinthe {:ok, response} or {:error, error} tuple.

  • :input_object? - true | false. Defaults to false

    • If true, one arg with the name of :input will be generated.
    • If true, an input_object for the Command is expected to exist. See derive_mutation_input/2.
  • :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.