ash
ash copied to clipboard
Allow passing `load` keyword argument to generic action code interface
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
I'd be interested in attempting a PR for this issue if it is free to be assigned?
It's all yours 👌