ash icon indicating copy to clipboard operation
ash copied to clipboard

Allow passing `load` keyword argument to generic action code interface

Open atkallie opened this issue 4 months ago • 2 comments

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

AI Policy

  • [x] I agree to follow this project's AI Policy, or I agree that AI was not used while creating this issue.

Is your feature request related to a problem? Please describe.

Currently, when using a generic action loading things on a resource is only supported by doing something like:

{:ok, resource} = Foo.Bar.some_generic_action(input, actor: actor, tenant: tenant)
resource = Ash.load!(result, [:something], authorize?: false)

CRUD actions support a load keyword argument to be passed to the action.

Describe the solution you'd like

It would be nice to be able to do the following, as is the case for CRUD actions:

{:ok, resource} = Foo.Bar.some_generic_action(input, actor: actor, tenant: tenant, load: [:something])

Describe alternatives you've considered

See above workaround.

Additional context

No response

atkallie avatar Sep 10 '25 05:09 atkallie

I'd be interested in attempting a PR for this issue if it is free to be assigned?

zackattackz avatar Dec 10 '25 18:12 zackattackz

It's all yours 👌

zachdaniel avatar Dec 10 '25 20:12 zachdaniel