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
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?
2 Replies
ZachDaniel
ZachDaniel•2y ago
not yet 🙂 you'll have to handwrite the absinthe code for it for now, but the goal is to support them natively like the other action types
Adam Harris
Adam HarrisOP•2y ago
ok great, thanks for the clarification

Did you find this page helpful?