@@ -154,11 +154,36 @@ def can_access_root_value():
154154 )
155155
156156 def supports_mutations_returning_null ():
157+ def null_resolve (_info , ** _input ) -> None :
158+ return None
159+
160+ some_mutation = mutation_with_client_mutation_id (
161+ "SomeMutation" , {}, {"result" : GraphQLField (GraphQLInt )}, null_resolve
162+ )
163+ schema = wrap_in_schema ({"someMutation" : some_mutation })
164+ source = """
165+ mutation {
166+ someMutation(input: {clientMutationId: "abc"}) {
167+ result
168+ clientMutationId
169+ }
170+ }
171+ """
172+ assert graphql_sync (schema , source ) == (
173+ {"someMutation" : {"result" : None , "clientMutationId" : "abc" }},
174+ None ,
175+ )
176+
177+ @mark .asyncio
178+ async def supports_async_mutations_returning_null ():
179+ async def null_resolve (_info , ** _input ) -> None :
180+ return None
181+
157182 some_mutation = mutation_with_client_mutation_id (
158183 "SomeMutation" ,
159184 {},
160185 {"result" : GraphQLField (GraphQLInt )},
161- lambda _info , ** _input : None ,
186+ null_resolve ,
162187 )
163188 schema = wrap_in_schema ({"someMutation" : some_mutation })
164189 source = """
@@ -169,7 +194,7 @@ def supports_mutations_returning_null():
169194 }
170195 }
171196 """
172- assert graphql_sync (schema , source ) == (
197+ assert await graphql (schema , source ) == (
173198 {"someMutation" : {"result" : None , "clientMutationId" : "abc" }},
174199 None ,
175200 )
0 commit comments