Skip to content

Commit 2d98c47

Browse files
committed
Test absence of name clash between type names and directives
Replicates graphql/graphql-js@732c90f
1 parent 7e8a355 commit 2d98c47

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ a query language for APIs created by Facebook.
1313

1414
The current version 1.0.0rc2 of GraphQL-core-next is up-to-date with GraphQL.js
1515
version 14.0.0rc2. All parts of the API are covered by an extensive test
16-
suite of currently 1529 unit tests.
16+
suite of currently 1530 unit tests.
1717

1818

1919
## Documentation

tests/utilities/test_build_ast_schema.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,20 @@ def unknown_subscription_type():
885885
assert msg == (
886886
"Specified subscription type 'Awesome' not found in document.")
887887

888+
def does_not_consider_directive_names():
889+
body = dedent("""
890+
schema {
891+
query: Foo
892+
}
893+
894+
directive @ Foo on QUERY
895+
""")
896+
doc = parse(body)
897+
with raises(TypeError) as exc_info:
898+
build_ast_schema(doc)
899+
msg = str(exc_info.value)
900+
assert msg == "Specified query type 'Foo' not found in document."
901+
888902
def does_not_consider_operation_names():
889903
body = dedent("""
890904
schema {

0 commit comments

Comments
 (0)