Ash FrameworkAF
Ash Framework3y ago
1 reply
Blibs

parse filter with fields from another resource relationship

I'm using Ash.Filter.parse/2 to generate filters using the list syntax, for example:

Ash.Filter.parse(Template, [
  or: [
    [male_content: [not_equals: "hue"]],
    [male_content: [equals: "hua"]]
  ]
])


Now, let's say that my Template resource has relationship with another resource School and I want to do a filter expression like this: school.name == "bla"

I'm not sure how to express that I'm accessing the name field inside the school relationship field.

I tried something like this:

Ash.Filter.parse(Template, [{"school.name", "bla"}])


But this doesn't work, and at the same time I can't find examples with relationships in the documentation.
Was this page helpful?