From f4fe2f73e7c4a878f6b5a803d5246f7a995c8773 Mon Sep 17 00:00:00 2001 From: Jonas Helfer Date: Wed, 27 Apr 2016 22:52:40 -0700 Subject: [PATCH] remove all 'instanceof GraphQLSchema' checks --- src/execution/execute.js | 5 ----- src/utilities/extendSchema.js | 4 ---- src/validation/validate.js | 5 ----- 3 files changed, 14 deletions(-) diff --git a/src/execution/execute.js b/src/execution/execute.js index 29e9de0e97..ecf3cff3f2 100644 --- a/src/execution/execute.js +++ b/src/execution/execute.js @@ -117,11 +117,6 @@ export function execute( operationName?: ?string ): Promise { invariant(schema, 'Must provide schema'); - invariant( - schema instanceof GraphQLSchema, - 'Schema must be an instance of GraphQLSchema. Also ensure that there are ' + - 'not multiple versions of GraphQL installed in your node_modules directory.' - ); // If a valid context cannot be created due to incorrect arguments, // this will throw an error. diff --git a/src/utilities/extendSchema.js b/src/utilities/extendSchema.js index 2a7f57a75d..2b2b9db7aa 100644 --- a/src/utilities/extendSchema.js +++ b/src/utilities/extendSchema.js @@ -94,10 +94,6 @@ export function extendSchema( schema: GraphQLSchema, documentAST: Document ): GraphQLSchema { - invariant( - schema instanceof GraphQLSchema, - 'Must provide valid GraphQLSchema' - ); invariant( documentAST && documentAST.kind === DOCUMENT, diff --git a/src/validation/validate.js b/src/validation/validate.js index b601e79042..e22ffbf46e 100644 --- a/src/validation/validate.js +++ b/src/validation/validate.js @@ -53,11 +53,6 @@ export function validate( ): Array { invariant(schema, 'Must provide schema'); invariant(ast, 'Must provide document'); - invariant( - schema instanceof GraphQLSchema, - 'Schema must be an instance of GraphQLSchema. Also ensure that there are ' + - 'not multiple versions of GraphQL installed in your node_modules directory.' - ); const typeInfo = new TypeInfo(schema); return visitUsingRules(schema, typeInfo, ast, rules || specifiedRules); }