How to manage relationships with AshGraphql
I have a Resource called
WebSite
that has_many :components
, and each is a WebComponent
. This test failed:
In the list of components
in the input
, does each component need to be individually JSON-encoded? Apparently it does, because when I encode the component, the test passes. Why would this need to be JSON-encoded? Is this documented somewhere? I didn't see mention of it.3 Replies
You need to specify the managed relationship in the graphql dsl: https://ash-hq.org/docs/dsl/ash-resource#graphql-managed_relationships-managed_relationship
Got it. thanks @Zach Daniel !
One thing about that page you referenced. The page is for the
Ash.Resource
DSL, and the information in it is about AshGraphql. I never would have expected to find direct info about AshGraphql inside the Ash.Resource documentation.Yeah, so we combined it to be about the entity that the DSL belongs in. I can see how that would be confusing