how to personalize resolve DjangoObjectType #1169
-
My schema
My question is how to personalize resolve_cities in CountryNode class. Something like this
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I've done it with Object Type but I do not want to lose the relay pagination |
Beta Was this translation helpful? Give feedback.
-
You shouldn't be trying to add a resolver for Cities on the Country Node. The only reason you would add a field and resolver directly on the Type definition is if it is not defined in the django model. You should be able to add the custom resolver in your query, like:
Hope this helps. Cheers |
Beta Was this translation helpful? Give feedback.
-
Hey @yoelvys - it looks like @louisdvs is providing the correct solution. Closing as resolved. |
Beta Was this translation helpful? Give feedback.
You shouldn't be trying to add a resolver for Cities on the Country Node. The only reason you would add a field and resolver directly on the Type definition is if it is not defined in the django model.
You should be able to add the custom resolver in your query, like:
Hope this helps. Cheers