From 27402ecce674bb722cc59a42ca93c932b1e2ce22 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Thu, 25 Jun 2020 11:49:51 +0100 Subject: [PATCH] Add test to check that Query type must be defined --- graphene/types/tests/test_schema.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/graphene/types/tests/test_schema.py b/graphene/types/tests/test_schema.py index 7a1c299a..0c85e170 100644 --- a/graphene/types/tests/test_schema.py +++ b/graphene/types/tests/test_schema.py @@ -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."