@@ -101,7 +101,7 @@ When we execute a query against that schema.
101
101
query_string = " { me { fullName } }"
102
102
result = schema.execute(query_string)
103
103
104
- assert result[ " data" ] [" me" ] == {" fullName" : " Luke Skywalker" )
104
+ assert result. data[" me" ] == {" fullName" : " Luke Skywalker" )
105
105
106
106
Then we go through the following steps to resolve this query:
107
107
@@ -212,7 +212,7 @@ If the :ref:`ResolverParamParent` is a dictionary, the resolver will look for a
212
212
213
213
from graphene import ObjectType, String, Field, Schema
214
214
215
- PersonValueObject = namedtuple(' Person' , [' first_name' , ' last_name' ])
215
+ PersonValueObject = namedtuple(" Person" , [" first_name" , " last_name" ])
216
216
217
217
class Person(ObjectType):
218
218
first_name = String()
@@ -224,7 +224,7 @@ If the :ref:`ResolverParamParent` is a dictionary, the resolver will look for a
224
224
225
225
def resolve_me(parent, info):
226
226
# always pass an object for `me` field
227
- return PersonValueObject(first_name = ' Luke' , last_name = ' Skywalker' )
227
+ return PersonValueObject(first_name = " Luke" , last_name = " Skywalker" )
228
228
229
229
def resolve_my_best_friend(parent, info):
230
230
# always pass a dictionary for `my_best_fiend_field`
@@ -238,10 +238,10 @@ If the :ref:`ResolverParamParent` is a dictionary, the resolver will look for a
238
238
}
239
239
''' )
240
240
# With default resolvers we can resolve attributes from an object..
241
- assert result.data[' me ' ] == {" firstName" : " Luke" , " lastName" : " Skywalker" }
241
+ assert result.data[" me " ] == {" firstName" : " Luke" , " lastName" : " Skywalker" }
242
242
243
243
# With default resolvers, we can also resolve keys from a dictionary..
244
- assert result.data[' myBestFriend' ] == {" firstName" : " R2" , " lastName" : " D2" }
244
+ assert result.data[" myBestFriend" ] == {" firstName" : " R2" , " lastName" : " D2" }
245
245
246
246
Advanced
247
247
~~~~~~~~
0 commit comments