Skip to content

Commit 2d8699c

Browse files
committed
test_validation: Test root type validation with multiple types
Replicates graphql/graphql-js@d3d68e8
1 parent 7dcc512 commit 2d8699c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/type/test_validation.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,12 @@ def rejects_a_schema_extended_with_invalid_root_types():
364364
input SomeInputObject {
365365
test: String
366366
}
367+
368+
scalar SomeScalar
369+
370+
enum SomeEnum {
371+
ENUM_VALUE
372+
}
367373
"""
368374
)
369375
schema = extend_schema(
@@ -381,7 +387,7 @@ def rejects_a_schema_extended_with_invalid_root_types():
381387
parse(
382388
"""
383389
extend schema {
384-
mutation: SomeInputObject
390+
mutation: SomeScalar
385391
}
386392
"""
387393
),
@@ -391,7 +397,7 @@ def rejects_a_schema_extended_with_invalid_root_types():
391397
parse(
392398
"""
393399
extend schema {
394-
subscription: SomeInputObject
400+
subscription: SomeEnum
395401
}
396402
"""
397403
),
@@ -404,12 +410,12 @@ def rejects_a_schema_extended_with_invalid_root_types():
404410
},
405411
{
406412
"message": "Mutation root type must be Object type"
407-
" if provided, it cannot be SomeInputObject.",
413+
" if provided, it cannot be SomeScalar.",
408414
"locations": [(3, 29)],
409415
},
410416
{
411417
"message": "Subscription root type must be Object type"
412-
" if provided, it cannot be SomeInputObject.",
418+
" if provided, it cannot be SomeEnum.",
413419
"locations": [(3, 33)],
414420
},
415421
]

0 commit comments

Comments
 (0)