From 7d32f7c085e1e1b1ce082e9a641457229f2e4d51 Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Mon, 13 Jul 2020 02:10:25 +0300 Subject: [PATCH] introspection-test: improve testing of trivial resolvers --- src/type/__tests__/introspection-test.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/type/__tests__/introspection-test.js b/src/type/__tests__/introspection-test.js index 6b22998625..6a9abf4d49 100644 --- a/src/type/__tests__/introspection-test.js +++ b/src/type/__tests__/introspection-test.js @@ -1319,20 +1319,36 @@ describe('Introspection', () => { }); }); - it('executes an introspection query without calling global fieldResolver', () => { + it('executes an introspection query without calling global resolvers', () => { const schema = buildSchema(` type Query { someField: String } `); - const source = getIntrospectionQuery({ directiveIsRepeatable: true }); + const source = getIntrospectionQuery({ + specifiedByUrl: true, + directiveIsRepeatable: true, + schemaDescription: true, + }); // istanbul ignore next (Called only to fail test) function fieldResolver(_1, _2, _3, info) { invariant(false, `Called on ${info.parentType.name}::${info.fieldName}`); } - expect(() => graphqlSync({ schema, source, fieldResolver })).to.not.throw(); + // istanbul ignore next (Called only to fail test) + function typeResolver(_1, _2, info) { + invariant(false, `Called on ${info.parentType.name}::${info.fieldName}`); + } + + expect(() => + graphqlSync({ + schema, + source, + fieldResolver, + typeResolver, + }), + ).to.not.throw(); }); });