Skip to content
This repository was archived by the owner on Feb 6, 2025. It is now read-only.

Commit 4fd8dda

Browse files
Add test for querying for suppressed type (#980)
1 parent 9e7be5a commit 4fd8dda

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

graphql_compiler/tests/schema_transformation_tests/test_rename_query.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from ...schema_transformation.rename_query import rename_query
1010
from ...schema_transformation.rename_schema import rename_schema
1111
from .example_schema import basic_renamed_schema, basic_schema
12+
from .input_schema_strings import InputSchemaStrings as ISS
1213

1314

1415
class TestRenameQuery(unittest.TestCase):
@@ -295,3 +296,19 @@ def test_invalid_fragment(self):
295296
)
296297
with self.assertRaises(GraphQLValidationError):
297298
rename_query(parse(query_string), rename_schema(basic_schema, {}, {}))
299+
300+
def test_query_for_suppressed_type(self):
301+
query_string = dedent(
302+
"""\
303+
{
304+
Human {
305+
id @output(out_name: "id")
306+
}
307+
}
308+
"""
309+
)
310+
with self.assertRaises(GraphQLValidationError):
311+
rename_query(
312+
parse(query_string),
313+
rename_schema(parse(ISS.multiple_fields_schema), {"Human": None}, {}),
314+
)

0 commit comments

Comments
 (0)