Using AshGraphql to fetch a single item without providing arguments
My app uses attribute-based multitenancy. There is a resource called
WebSite
, and the tenant would normally have only one of these. I am trying to create a GraphQL query called getWebSite
that returns the tenant's WebSite
, but the query response has the error, "In argument "id": Expected type "ID!", found null."
I don't want the query to take any arguments.
Here is the test that reproduces there error:
Here are the relevant parts of the WebSite
resource:
How do I solve this?5 Replies
I believe the pattern for this is
get :get_web_site, :get_web_site, identity: false
to instruct it to not use any of the identities on the resource to look it upThank you. I will try this...
It worked!
🥳
Is there documentation on this? I couldn't find any documentation on the AshGraph queries and mutations DSL.
Never mind. I found it under the Ash.Resource documentation.
👍