@@ -116,6 +116,9 @@ def transform(new_email):
116
116
return subscribe (email_schema , document , data )
117
117
118
118
119
+ DummyQueryType = GraphQLObjectType ("Query" , {"dummy" : GraphQLField (GraphQLString )})
120
+
121
+
119
122
# Check all error cases when initializing the subscription.
120
123
def describe_subscription_initialization_phase ():
121
124
@mark .asyncio
@@ -143,7 +146,7 @@ async def empty_async_iterator(_info):
143
146
@mark .asyncio
144
147
async def accepts_multiple_subscription_fields_defined_in_schema ():
145
148
schema = GraphQLSchema (
146
- query = QueryType ,
149
+ query = DummyQueryType ,
147
150
subscription = GraphQLObjectType (
148
151
"Subscription" ,
149
152
{
@@ -171,7 +174,7 @@ async def foo_generator(_obj, _info):
171
174
yield {"foo" : "FooValue" }
172
175
173
176
schema = GraphQLSchema (
174
- query = QueryType ,
177
+ query = DummyQueryType ,
175
178
subscription = GraphQLObjectType (
176
179
"Subscription" ,
177
180
{"foo" : GraphQLField (GraphQLString , subscribe = foo_generator )},
@@ -192,7 +195,7 @@ async def foo_generator(_obj, _info):
192
195
yield {"foo" : "FooValue" }
193
196
194
197
schema = GraphQLSchema (
195
- query = QueryType ,
198
+ query = DummyQueryType ,
196
199
subscription = GraphQLObjectType (
197
200
"Subscription" ,
198
201
{"foo" : GraphQLField (GraphQLString , subscribe = foo_generator )},
@@ -219,7 +222,7 @@ async def subscribe_bar(_obj, _info): # pragma: no cover
219
222
yield {"bar" : "BarValue" }
220
223
221
224
schema = GraphQLSchema (
222
- query = QueryType ,
225
+ query = DummyQueryType ,
223
226
subscription = GraphQLObjectType (
224
227
"Subscription" ,
225
228
{
@@ -246,7 +249,7 @@ async def throws_an_error_if_some_of_required_arguments_are_missing():
246
249
document = parse ("subscription { foo }" )
247
250
248
251
schema = GraphQLSchema (
249
- query = QueryType ,
252
+ query = DummyQueryType ,
250
253
subscription = GraphQLObjectType (
251
254
"Subscription" , {"foo" : GraphQLField (GraphQLString )}
252
255
),
@@ -267,7 +270,7 @@ async def throws_an_error_if_some_of_required_arguments_are_missing():
267
270
@mark .asyncio
268
271
async def resolves_to_an_error_for_unknown_subscription_field ():
269
272
schema = GraphQLSchema (
270
- query = QueryType ,
273
+ query = DummyQueryType ,
271
274
subscription = GraphQLObjectType (
272
275
"Subscription" , {"foo" : GraphQLField (GraphQLString )}
273
276
),
@@ -288,7 +291,7 @@ async def resolves_to_an_error_for_unknown_subscription_field():
288
291
@mark .asyncio
289
292
async def should_pass_through_unexpected_errors_thrown_in_subscribe ():
290
293
schema = GraphQLSchema (
291
- query = QueryType ,
294
+ query = DummyQueryType ,
292
295
subscription = GraphQLObjectType (
293
296
"Subscription" , {"foo" : GraphQLField (GraphQLString )}
294
297
),
@@ -300,7 +303,7 @@ async def should_pass_through_unexpected_errors_thrown_in_subscribe():
300
303
@mark .filterwarnings ("ignore:.* was never awaited:RuntimeWarning" )
301
304
async def throws_an_error_if_subscribe_does_not_return_an_iterator ():
302
305
schema = GraphQLSchema (
303
- query = QueryType ,
306
+ query = DummyQueryType ,
304
307
subscription = GraphQLObjectType (
305
308
"Subscription" ,
306
309
{
@@ -324,7 +327,7 @@ async def throws_an_error_if_subscribe_does_not_return_an_iterator():
324
327
async def resolves_to_an_error_for_subscription_resolver_errors ():
325
328
async def subscribe_with_fn (subscribe_fn : Callable ):
326
329
schema = GraphQLSchema (
327
- query = QueryType ,
330
+ query = DummyQueryType ,
328
331
subscription = GraphQLObjectType (
329
332
"Subscription" ,
330
333
{"foo" : GraphQLField (GraphQLString , subscribe = subscribe_fn )},
@@ -374,7 +377,7 @@ async def reject_error(*_args):
374
377
@mark .asyncio
375
378
async def resolves_to_an_error_if_variables_were_wrong_type ():
376
379
schema = GraphQLSchema (
377
- query = QueryType ,
380
+ query = DummyQueryType ,
378
381
subscription = GraphQLObjectType (
379
382
"Subscription" ,
380
383
{
@@ -743,7 +746,7 @@ def resolve_message(message, _info):
743
746
return message
744
747
745
748
schema = GraphQLSchema (
746
- query = QueryType ,
749
+ query = DummyQueryType ,
747
750
subscription = GraphQLObjectType (
748
751
"Subscription" ,
749
752
{
@@ -788,7 +791,7 @@ def resolve_message(message, _info):
788
791
return message
789
792
790
793
schema = GraphQLSchema (
791
- query = QueryType ,
794
+ query = DummyQueryType ,
792
795
subscription = GraphQLObjectType (
793
796
"Subscription" ,
794
797
{
0 commit comments