From 6c70ae7eb2a94cc7e093e70c85751d0166fb2df3 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Sat, 16 Mar 2019 11:54:00 +0000 Subject: [PATCH] Fix issue #890 --- docs/execution/execute.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/execution/execute.rst b/docs/execution/execute.rst index 21345aa3..706dd690 100644 --- a/docs/execution/execute.rst +++ b/docs/execution/execute.rst @@ -33,7 +33,7 @@ You can pass context to a query via ``context``. Variables -_______ +_________ You can pass variables to a query via ``variables``. @@ -41,10 +41,10 @@ You can pass variables to a query via ``variables``. .. code:: python class Query(graphene.ObjectType): - user = graphene.Field(User) + user = graphene.Field(User, id=graphene.ID(required=True)) - def resolve_user(self, info): - return info.context.get('user') + def resolve_user(_, info, id): + return get_user_by_id(id) schema = graphene.Schema(Query) result = schema.execute(