Skip to content

Parent not available on nested resolver #528

Answered by rafalp
bartenra asked this question in Q&A
Discussion options

You must be logged in to vote

resolve_organizations is root resolver, so its obj argument is None by default. This behavior is mentioned at the beginning or resolves documentation:

If the resolver is a root resolver (it belongs to the field defined on Query, Mutation or Subscription) and the GraphQL server implementation doesn't explicitly define value for this field, the value of this argument will be None.

resolve_organizations should retrieve organizations list from suitable place: database, config or 3rd party API.

Also returning resolve_owner as part of field looks wrong here. Why can't you embed this data directly and then use resolver on owner field to complete data resolution process?

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@bartenra
Comment options

@rafalp
Comment options

Answer selected by bartenra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants