Add test to check that Query type must be defined

This commit is contained in:
Jonathan Kim 2020-06-25 11:49:51 +01:00
parent 198a4c7b5e
commit 27402ecce6

View File

@ -59,3 +59,12 @@ def test_schema_str():
def test_schema_introspect():
schema = Schema(Query)
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."