File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ You can pass context to a query via ``context``.
2424 class Query (graphene .ObjectType ):
2525 name = graphene.String()
2626
27- def resolve_name (self , info ):
27+ def resolve_name (root , info ):
2828 return info.context.get(' name' )
2929
3030 schema = graphene.Schema(Query)
@@ -33,18 +33,18 @@ You can pass context to a query via ``context``.
3333
3434
3535 Variables
36- _______
36+ _________
3737
3838You can pass variables to a query via ``variables ``.
3939
4040
4141.. code :: python
4242
4343 class Query (graphene .ObjectType ):
44- user = graphene.Field(User)
44+ user = graphene.Field(User, id = graphene.ID( required = True ) )
4545
46- def resolve_user (self , info ):
47- return info.context.get( ' user ' )
46+ def resolve_user (root , info , id ):
47+ return get_user_by_id( id )
4848
4949 schema = graphene.Schema(Query)
5050 result = schema.execute(
You can’t perform that action at this time.
0 commit comments