Add basic resolvers to Relay Full example in docs/queries.rst.

Added basic resolvers to Full example in Relay section.
This commit is contained in:
changeling 2019-05-12 13:17:05 -05:00
parent 7cf4b46f57
commit 8b757bc556

View File

@ -266,5 +266,11 @@ Full example
question = graphene.Field(QuestionType)
questions = relay.ConnectionField(QuestionConnection)
def resolve_question(root, info, **kwargs):
return Question
def resolve_questions(root, info, **kwargs):
return Question.objects.all()
See the `Relay documentation <https://docs.graphene-python.org/en/latest/relay/nodes/>`__ on
the core graphene pages for more information on customing the Relay experience.