Passing arguments when calling a Resource.Action via Ash.Query (Solved)


Can’t wrap my head around passing arguments to an Action when it is invoke via Ash.Query.

I have some dynamic Generic Actions for specific table column names.

So before When I was doing.

MyApp.MyApi.Resource.get_distinct_values(%{column_name: "test"})

And due to mulitenancy and having to use set_tenant now it is more like

|> Ash.Query.for_read(:get_distinct_values)
|> Ash.Query.set_tenant("tenant1")

How do I pass argument to the action when using this form?

Thank you bunch!

Answering my own question:

By passing it in the for_read argument


Welcome @CYMKD. Glad you found the answer :slight_smile:

1 Like