mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-18 03:52:24 +03:00
Add test to check that Query type must be defined
This commit is contained in:
parent
198a4c7b5e
commit
27402ecce6
|
@ -59,3 +59,12 @@ def test_schema_str():
|
||||||
def test_schema_introspect():
|
def test_schema_introspect():
|
||||||
schema = Schema(Query)
|
schema = Schema(Query)
|
||||||
assert "__schema" in schema.introspect()
|
assert "__schema" in schema.introspect()
|
||||||
|
|
||||||
|
|
||||||
|
def test_schema_requires_query_type():
|
||||||
|
schema = Schema()
|
||||||
|
result = schema.execute("query {}")
|
||||||
|
|
||||||
|
assert len(result.errors) == 1
|
||||||
|
error = result.errors[0]
|
||||||
|
assert error.message == "Query root type must be provided."
|
||||||
|
|
Loading…
Reference in New Issue
Block a user