Skip to content

Commit 27402ec

Browse files
committed
Add test to check that Query type must be defined
1 parent 198a4c7 commit 27402ec

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

graphene/types/tests/test_schema.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,12 @@ def test_schema_str():
5959
def test_schema_introspect():
6060
schema = Schema(Query)
6161
assert "__schema" in schema.introspect()
62+
63+
64+
def test_schema_requires_query_type():
65+
schema = Schema()
66+
result = schema.execute("query {}")
67+
68+
assert len(result.errors) == 1
69+
error = result.errors[0]
70+
assert error.message == "Query root type must be provided."

0 commit comments

Comments
 (0)