From 34de7af37871a5435358945ccc9fac0960ca93ec Mon Sep 17 00:00:00 2001 From: Trevor Livingston Date: Wed, 18 May 2022 22:03:43 +0000 Subject: [PATCH] Updated pruning to latest. Removed unused options in TS defs. Updated typeDefs types supported to include GraphQLSchema. --- lib/__tests__.js | 2 +- lib/index.d.ts | 12 +----------- lib/index.js | 2 +- package.json | 3 ++- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/lib/__tests__.js b/lib/__tests__.js index ade8634..88ac228 100644 --- a/lib/__tests__.js +++ b/lib/__tests__.js @@ -2,7 +2,7 @@ const Test = require('tape'); const gql = require('graphql-tag'); -const { SchemaDirectiveVisitor } = require('@graphql-tools/utils'); +const { SchemaDirectiveVisitor } = require('graphql-tools'); const graphql = require('graphql'); const GraphQLComponent = require('./index'); diff --git a/lib/index.d.ts b/lib/index.d.ts index 98d9acc..9f3a325 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -23,21 +23,11 @@ interface IContextWrapper extends ContextFunction { } interface IGraphQLComponentOptions { - types?: (string | Source | DocumentNode)[] | (string | Source | DocumentNode); + types?: (string | Source | DocumentNode | GraphQLSchema)[] | (string | Source | DocumentNode | GraphQLSchema); resolvers?: IResolvers; mocks?: boolean | MocksConfigFunction; directives?: DirectiveUseMap; federation?: boolean; - makeExecutableSchema?: ({ - typeDefs, - resolvers, - resolverValidationOptions, - parseOptions, - inheritResolversFromInterfaces, - pruningOptions, - updateResolversInPlace, - schemaExtensions - }) => IExecutableSchemaDefinition; imports?: GraphQLComponent[] | IGraphQLComponentConfigObject[]; context?: IContextConfig; dataSources?: any[]; diff --git a/lib/index.js b/lib/index.js index 5c249db..157f9f9 100644 --- a/lib/index.js +++ b/lib/index.js @@ -8,9 +8,9 @@ const { mergeTypeDefs, addMocksToSchema, makeExecutableSchema, - pruneSchema, SchemaDirectiveVisitor } = require('graphql-tools'); +const { pruneSchema } = require('@graphql-tools/utils'); const { bindResolvers } = require('./resolvers'); const { wrapContext, createContext } = require('./context'); diff --git a/package.json b/package.json index cc4df78..8579e9e 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ "dependencies": { "@apollo/federation": "^0.28.0", "debug": "^4.3.1", - "graphql-tools": "^7.0.5" + "graphql-tools": "^7.0.5", + "@graphql-tools/utils": "^8.6.10" }, "peerDependencies": { "graphql": "^15.0.0"