Ash FrameworkAF
Ash Framework7mo ago
59 replies
Oliver

How to re-use a resource as an argument type inside {:array, ...} ?

This does not work:
argument :elements, {:array, :struct},
        allow_nil?: false,
        constraints: [instance_of: __MODULE__]


And the only constraint I can see that affects the items inside is nil_items?

If I use a custom type I need to wrap it one extra layer so that isnt the same as this..

Anyone got any ideas?
Solution
You can make a map type and set graphql_define_type? to false, and graphql_input_type to something like {:list, :some_input}
Was this page helpful?