@@ -96,14 +96,14 @@ async def mutate_and_get_one_as_payload_async(_info, **_input):
96
96
97
97
def describe_mutation_with_client_mutation_id ():
98
98
def requires_an_argument ():
99
- query = """
99
+ source = """
100
100
mutation M {
101
101
simpleMutation {
102
102
result
103
103
}
104
104
}
105
105
"""
106
- assert graphql_sync (schema , query ) == (
106
+ assert graphql_sync (schema , source ) == (
107
107
None ,
108
108
[
109
109
{
@@ -116,21 +116,21 @@ def requires_an_argument():
116
116
)
117
117
118
118
def returns_the_same_client_mutation_id ():
119
- query = """
119
+ source = """
120
120
mutation M {
121
121
simpleMutation(input: {clientMutationId: "abc"}) {
122
122
result
123
123
clientMutationId
124
124
}
125
125
}
126
126
"""
127
- assert graphql_sync (schema , query ) == (
127
+ assert graphql_sync (schema , source ) == (
128
128
{"simpleMutation" : {"result" : 1 , "clientMutationId" : "abc" }},
129
129
None ,
130
130
)
131
131
132
132
def supports_thunks_as_input_and_output_fields ():
133
- query = """
133
+ source = """
134
134
mutation M {
135
135
simpleMutationWithThunkFields(
136
136
input: {inputData: 1234, clientMutationId: "abc"}) {
@@ -139,7 +139,7 @@ def supports_thunks_as_input_and_output_fields():
139
139
}
140
140
}
141
141
"""
142
- assert graphql_sync (schema , query ) == (
142
+ assert graphql_sync (schema , source ) == (
143
143
{
144
144
"simpleMutationWithThunkFields" : {
145
145
"result" : 1234 ,
@@ -151,50 +151,50 @@ def supports_thunks_as_input_and_output_fields():
151
151
152
152
@mark .asyncio
153
153
async def supports_async_mutations ():
154
- query = """
154
+ source = """
155
155
mutation M {
156
156
simpleAsyncMutation(input: {clientMutationId: "abc"}) {
157
157
result
158
158
clientMutationId
159
159
}
160
160
}
161
161
"""
162
- assert await graphql (schema , query ) == (
162
+ assert await graphql (schema , source ) == (
163
163
{"simpleAsyncMutation" : {"result" : 1 , "clientMutationId" : "abc" }},
164
164
None ,
165
165
)
166
166
167
167
def can_access_root_value ():
168
- query = """
168
+ source = """
169
169
mutation M {
170
170
simpleRootValueMutation(input: {clientMutationId: "abc"}) {
171
171
result
172
172
clientMutationId
173
173
}
174
174
}
175
175
"""
176
- assert graphql_sync (schema , query , root_value = Result (1 )) == (
176
+ assert graphql_sync (schema , source , root_value = Result (1 )) == (
177
177
{"simpleRootValueMutation" : {"result" : 1 , "clientMutationId" : "abc" }},
178
178
None ,
179
179
)
180
180
181
181
def supports_mutations_returning_null ():
182
- query = """
182
+ source = """
183
183
mutation M {
184
184
simpleRootValueMutation(input: {clientMutationId: "abc"}) {
185
185
result
186
186
clientMutationId
187
187
}
188
188
}
189
189
"""
190
- assert graphql_sync (schema , query , root_value = None ) == (
190
+ assert graphql_sync (schema , source , root_value = None ) == (
191
191
{"simpleRootValueMutation" : {"result" : None , "clientMutationId" : "abc" }},
192
192
None ,
193
193
)
194
194
195
195
def describe_introspection ():
196
196
def contains_correct_input ():
197
- query = """
197
+ source = """
198
198
{
199
199
__type(name: "SimpleMutationInput") {
200
200
name
@@ -209,7 +209,7 @@ def contains_correct_input():
209
209
}
210
210
}
211
211
"""
212
- assert graphql_sync (schema , query ) == (
212
+ assert graphql_sync (schema , source ) == (
213
213
{
214
214
"__type" : {
215
215
"name" : "SimpleMutationInput" ,
@@ -226,7 +226,7 @@ def contains_correct_input():
226
226
)
227
227
228
228
def contains_correct_payload ():
229
- query = """
229
+ source = """
230
230
{
231
231
__type(name: "SimpleMutationPayload") {
232
232
name
@@ -241,7 +241,7 @@ def contains_correct_payload():
241
241
}
242
242
}
243
243
"""
244
- assert graphql_sync (schema , query ) == (
244
+ assert graphql_sync (schema , source ) == (
245
245
{
246
246
"__type" : {
247
247
"name" : "SimpleMutationPayload" ,
@@ -262,7 +262,7 @@ def contains_correct_payload():
262
262
)
263
263
264
264
def contains_correct_field ():
265
- query = """
265
+ source = """
266
266
{
267
267
__schema {
268
268
mutationType {
@@ -288,7 +288,7 @@ def contains_correct_field():
288
288
}
289
289
}
290
290
"""
291
- assert graphql_sync (schema , query ) == (
291
+ assert graphql_sync (schema , source ) == (
292
292
{
293
293
"__schema" : {
294
294
"mutationType" : {
@@ -403,7 +403,7 @@ def contains_correct_field():
403
403
)
404
404
405
405
def contains_correct_descriptions ():
406
- query = """
406
+ source = """
407
407
{
408
408
__schema {
409
409
mutationType {
@@ -415,7 +415,7 @@ def contains_correct_descriptions():
415
415
}
416
416
}
417
417
"""
418
- assert graphql_sync (schema , query ) == (
418
+ assert graphql_sync (schema , source ) == (
419
419
{
420
420
"__schema" : {
421
421
"mutationType" : {
@@ -442,7 +442,7 @@ def contains_correct_descriptions():
442
442
)
443
443
444
444
def contains_correct_deprecation_reason ():
445
- query = """
445
+ source = """
446
446
{
447
447
__schema {
448
448
mutationType {
@@ -455,7 +455,7 @@ def contains_correct_deprecation_reason():
455
455
}
456
456
}
457
457
"""
458
- assert graphql_sync (schema , query ) == (
458
+ assert graphql_sync (schema , source ) == (
459
459
{
460
460
"__schema" : {
461
461
"mutationType" : {
0 commit comments