From 34de7af37871a5435358945ccc9fac0960ca93ec Mon Sep 17 00:00:00 2001 From: Trevor Livingston Date: Wed, 18 May 2022 22:03:43 +0000 Subject: [PATCH 1/2] 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" From 93a7959752647e99cf648445bf8befeb8a1c8d19 Mon Sep 17 00:00:00 2001 From: Trevor Livingston Date: Wed, 18 May 2022 22:05:10 +0000 Subject: [PATCH 2/2] Bumped version --- CHANGELOG.md | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aadbc64..5b5f388 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### v3.0.4 + +- Updated schema pruning dependency and TS definitions ### v3.0.3 diff --git a/package.json b/package.json index 8579e9e..92463b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "graphql-component", - "version": "3.0.3", + "version": "3.0.4", "description": "Build, customize and compose GraphQL schemas in a componentized fashion", "keywords": [ "graphql",