Ash FrameworkAF
Ash Framework3y ago
3 replies
Adam Harris

Can I expose a generic resource action via an Ash GraphQL mutation?

Hi, suppose I have an Ash resource with a generic action:

    action :my_generic_action, MyApi.MyResource do
      argument(:arg_1, :string, allow_nil?: false)
      argument(:arg_2, :string, allow_nil?: false)

      run(fn input, _context ->
        # Do some stuff here and return a record of type MyResource
      end)
    end


Then is it possible to expose it via an Ash GraphQL mutation?
Was this page helpful?