diff --git a/src/utilities/__tests__/buildASTSchema-test.js b/src/utilities/__tests__/buildASTSchema-test.js index b2f0a45eb5..b65b8a4d79 100644 --- a/src/utilities/__tests__/buildASTSchema-test.js +++ b/src/utilities/__tests__/buildASTSchema-test.js @@ -969,6 +969,20 @@ describe('Failures', () => { ); }); + it('Does not consider directive names', () => { + const body = dedent` + schema { + query: Foo + } + + directive @Foo on QUERY + `; + const doc = parse(body); + expect(() => buildASTSchema(doc)).to.throw( + 'Specified query type "Foo" not found in document.', + ); + }); + it('Does not consider operation names', () => { const body = dedent` schema {