mirror of
https://github.com/graphql-python/graphene.git
synced 2025-09-21 19:32:33 +03:00
Fix issue #890
This commit is contained in:
parent
ca9188a615
commit
6c70ae7eb2
|
@ -33,7 +33,7 @@ You can pass context to a query via ``context``.
|
||||||
|
|
||||||
|
|
||||||
Variables
|
Variables
|
||||||
_______
|
_________
|
||||||
|
|
||||||
You can pass variables to a query via ``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
|
.. code:: python
|
||||||
|
|
||||||
class Query(graphene.ObjectType):
|
class Query(graphene.ObjectType):
|
||||||
user = graphene.Field(User)
|
user = graphene.Field(User, id=graphene.ID(required=True))
|
||||||
|
|
||||||
def resolve_user(self, info):
|
def resolve_user(_, info, id):
|
||||||
return info.context.get('user')
|
return get_user_by_id(id)
|
||||||
|
|
||||||
schema = graphene.Schema(Query)
|
schema = graphene.Schema(Query)
|
||||||
result = schema.execute(
|
result = schema.execute(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user