diff --git a/package-lock.json b/package-lock.json index 9b897b49..46219579 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2232,6 +2232,84 @@ "to-fast-properties": "^2.0.0" } }, + "@graphql-tools/delegate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/delegate/-/delegate-6.0.0.tgz", + "integrity": "sha512-U4P7SiBezLia2MvVC87yGEUT5VexPCL1V4ZqB/AIt3NAPpSVUZVopknM2oBvWanPhbzeZ5pT6XdC50ma21D27Q==", + "requires": { + "@graphql-tools/schema": "6.0.0", + "@graphql-tools/utils": "6.0.0", + "tslib": "~2.0.0" + }, + "dependencies": { + "tslib": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.0.tgz", + "integrity": "sha512-lTqkx847PI7xEDYJntxZH89L2/aXInsyF2luSafe/+0fHOMjlBNXdH6th7f70qxLDhul7KZK0zC8V5ZIyHl0/g==" + } + } + }, + "@graphql-tools/schema": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-6.0.0.tgz", + "integrity": "sha512-bqPO0AWrWrb+MJiOszC6xdHKouKnViqE29p6y8FA6VYhJJxEggiPYCpVSbRzKIjni0NpvxeBTkt/6yfoCDL2ng==", + "requires": { + "@graphql-tools/utils": "6.0.0", + "tslib": "~2.0.0" + }, + "dependencies": { + "tslib": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.0.tgz", + "integrity": "sha512-lTqkx847PI7xEDYJntxZH89L2/aXInsyF2luSafe/+0fHOMjlBNXdH6th7f70qxLDhul7KZK0zC8V5ZIyHl0/g==" + } + } + }, + "@graphql-tools/stitch": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/stitch/-/stitch-6.0.0.tgz", + "integrity": "sha512-A7VLjQh7XHPYSP0N7ngit7/qIzuc7gEU0QEMVOM/CgfXafhT9PrVKudwjuNUwSaEoj+bYvt+InxrfFWzai5xnQ==", + "requires": { + "@graphql-tools/delegate": "6.0.0", + "@graphql-tools/schema": "6.0.0", + "@graphql-tools/utils": "6.0.0", + "@graphql-tools/wrap": "6.0.0", + "tslib": "~2.0.0" + }, + "dependencies": { + "tslib": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.0.tgz", + "integrity": "sha512-lTqkx847PI7xEDYJntxZH89L2/aXInsyF2luSafe/+0fHOMjlBNXdH6th7f70qxLDhul7KZK0zC8V5ZIyHl0/g==" + } + } + }, + "@graphql-tools/utils": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-6.0.0.tgz", + "integrity": "sha512-oU4f6w4+VKniFFTopUHUgFSuZpGxopjSFU0nhJ2X9Z2HietxnKaL38xoYTZACemlctlYiNeYj6Ha8Ew/FTp3qg==", + "requires": { + "camel-case": "4.1.1" + } + }, + "@graphql-tools/wrap": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/wrap/-/wrap-6.0.0.tgz", + "integrity": "sha512-jFDxawcmJOp7OKaSetOB0AW0IBhnBnjWE6I6pRibOl07K/kzbZ+4+UO91CSZg75jIifj2Z5s6AfKSiDn7Lgy+A==", + "requires": { + "@graphql-tools/delegate": "6.0.0", + "@graphql-tools/schema": "6.0.0", + "@graphql-tools/utils": "6.0.0", + "tslib": "~2.0.0" + }, + "dependencies": { + "tslib": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.0.tgz", + "integrity": "sha512-lTqkx847PI7xEDYJntxZH89L2/aXInsyF2luSafe/+0fHOMjlBNXdH6th7f70qxLDhul7KZK0zC8V5ZIyHl0/g==" + } + } + }, "@istanbuljs/load-nyc-config": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.0.0.tgz", @@ -2982,6 +3060,7 @@ "version": "0.2.15", "resolved": "https://registry.npmjs.org/apollo-link-http-common/-/apollo-link-http-common-0.2.15.tgz", "integrity": "sha512-+Heey4S2IPsPyTf8Ag3PugUupASJMW894iVps6hXbvwtg1aHSNMXUYO5VG7iRHkPzqpuzT4HMBanCTXPjtGzxg==", + "dev": true, "requires": { "apollo-link": "^1.2.13", "ts-invariant": "^0.4.0", @@ -3176,6 +3255,7 @@ "version": "13.0.0", "resolved": "https://registry.npmjs.org/apollo-upload-client/-/apollo-upload-client-13.0.0.tgz", "integrity": "sha512-lJ9/bk1BH1lD15WhWRha2J3+LrXrPIX5LP5EwiOUHv8PCORp4EUrcujrA3rI5hZeZygrTX8bshcuMdpqpSrvtA==", + "dev": true, "requires": { "@babel/runtime": "^7.9.2", "apollo-link": "^1.2.12", @@ -3187,6 +3267,7 @@ "version": "7.9.2", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.2.tgz", "integrity": "sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==", + "dev": true, "requires": { "regenerator-runtime": "^0.13.4" } @@ -3194,7 +3275,8 @@ "regenerator-runtime": { "version": "0.13.5", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz", - "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==" + "integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==", + "dev": true } } }, @@ -3851,6 +3933,15 @@ "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, + "camel-case": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.1.tgz", + "integrity": "sha512-7fa2WcG4fYFkclIvEmxBbTvmibwF2/agfEBc6q3lOpVu0A13ltLsA+Hr/8Hp6kp5f+G7hKi6t8lys6XxP+1K6Q==", + "requires": { + "pascal-case": "^3.1.1", + "tslib": "^1.10.0" + } + }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -5815,7 +5906,8 @@ "extract-files": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/extract-files/-/extract-files-8.0.0.tgz", - "integrity": "sha512-TsYR7plS+8iZGaB01A6IH91stHJzWu8K3Kr1jEjFy7YDHpDXhgMepjEQ/qGeNOlTUXor0MTL9Rudwg85ElOnNw==" + "integrity": "sha512-TsYR7plS+8iZGaB01A6IH91stHJzWu8K3Kr1jEjFy7YDHpDXhgMepjEQ/qGeNOlTUXor0MTL9Rudwg85ElOnNw==", + "dev": true }, "extsprintf": { "version": "1.3.0", @@ -7029,38 +7121,6 @@ "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.10.1.tgz", "integrity": "sha512-jApXqWBzNXQ8jYa/HLkZJaVw9jgwNqZkywa2zfFn16Iv1Zb7ELNHkJaXHR7Quvd5SIGsy6Ny7SUKATgnu05uEg==" }, - "graphql-tools": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/graphql-tools/-/graphql-tools-5.0.0.tgz", - "integrity": "sha512-5zn3vtn//382b7G3Wzz3d5q/sh+f7tVrnxeuhTMTJ7pWJijNqLxH7VEzv8VwXCq19zAzHYEosFHfXiK7qzvk7w==", - "requires": { - "apollo-link": "^1.2.14", - "apollo-upload-client": "^13.0.0", - "deprecated-decorator": "^0.1.6", - "form-data": "^3.0.0", - "iterall": "^1.3.0", - "node-fetch": "^2.6.0", - "tslib": "^1.11.1", - "uuid": "^7.0.3" - }, - "dependencies": { - "iterall": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/iterall/-/iterall-1.3.0.tgz", - "integrity": "sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg==" - }, - "tslib": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", - "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==" - }, - "uuid": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", - "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==" - } - } - }, "graphql-upload": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/graphql-upload/-/graphql-upload-11.0.0.tgz", @@ -8907,6 +8967,14 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, + "lower-case": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.1.tgz", + "integrity": "sha512-LiWgfDLLb1dwbFQZsSglpRj+1ctGnayXz3Uv0/WO8n558JycT5fg6zkNcnW0G68Nn0aEldTFeEfmjCfmqry/rQ==", + "requires": { + "tslib": "^1.10.0" + } + }, "lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -9702,6 +9770,15 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, + "no-case": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.3.tgz", + "integrity": "sha512-ehY/mVQCf9BL0gKfsJBvFJen+1V//U+0HQMPrWct40ixE4jnv0bfvxDbWtAHL9EcaPEOJHVVYKoQn1TlZUB8Tw==", + "requires": { + "lower-case": "^2.0.1", + "tslib": "^1.10.0" + } + }, "node-addon-api": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.0.tgz", @@ -10323,6 +10400,15 @@ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, + "pascal-case": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.1.tgz", + "integrity": "sha512-XIeHKqIrsquVTQL2crjq3NfJUxmdLasn3TYOU0VBM+UX2a6ztAWBlJQBePLGY7VHW8+2dRadeIPK5+KImwTxQA==", + "requires": { + "no-case": "^3.0.3", + "tslib": "^1.10.0" + } + }, "pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", diff --git a/package.json b/package.json index 8f312170..150b23d8 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,8 @@ "license": "BSD-3-Clause", "dependencies": { "@apollographql/graphql-playground-html": "1.6.24", + "@graphql-tools/stitch": "^6.0.0", + "@graphql-tools/utils": "^6.0.0", "@parse/fs-files-adapter": "1.0.1", "@parse/push-adapter": "3.2.0", "@parse/s3-files-adapter": "1.4.0", @@ -35,7 +37,6 @@ "graphql": "15.0.0", "graphql-list-fields": "2.0.2", "graphql-relay": "^0.6.0", - "graphql-tools": "^5.0.0", "graphql-upload": "11.0.0", "intersect": "1.0.1", "jsonwebtoken": "8.5.1", diff --git a/spec/ParseGraphQLServer.spec.js b/spec/ParseGraphQLServer.spec.js index dcfb693c..b805cabe 100644 --- a/spec/ParseGraphQLServer.spec.js +++ b/spec/ParseGraphQLServer.spec.js @@ -10987,8 +10987,8 @@ describe('ParseGraphQLServer', () => { httpServer = http.createServer(expressApp); parseGraphQLServer = new ParseGraphQLServer(parseServer, { graphQLPath: '/graphql', - graphQLCustomTypeDefs: ({ autoSchema, mergeSchemas }) => - mergeSchemas({ schemas: [autoSchema] }), + graphQLCustomTypeDefs: ({ autoSchema, stitchSchemas }) => + stitchSchemas({ subschemas: [autoSchema] }), }); parseGraphQLServer.applyGraphQL(expressApp); diff --git a/src/GraphQL/ParseGraphQLSchema.js b/src/GraphQL/ParseGraphQLSchema.js index 9616baa8..ce97ae6c 100644 --- a/src/GraphQL/ParseGraphQLSchema.js +++ b/src/GraphQL/ParseGraphQLSchema.js @@ -5,7 +5,8 @@ import { DocumentNode, GraphQLNamedType, } from 'graphql'; -import { mergeSchemas, SchemaDirectiveVisitor } from 'graphql-tools'; +import { stitchSchemas } from '@graphql-tools/stitch'; +import { SchemaDirectiveVisitor } from '@graphql-tools/utils'; import requiredParameter from '../requiredParameter'; import * as defaultGraphQLTypes from './loaders/defaultGraphQLTypes'; import * as parseClassTypes from './loaders/parseClassTypes'; @@ -251,7 +252,7 @@ class ParseGraphQLSchema { } } ); - this.graphQLSchema = mergeSchemas({ + this.graphQLSchema = stitchSchemas({ schemas: [ this.graphQLSchemaDirectivesDefinitions, this.graphQLAutoSchema, @@ -262,10 +263,10 @@ class ParseGraphQLSchema { this.graphQLSchema = await this.graphQLCustomTypeDefs({ directivesDefinitionsSchema: this.graphQLSchemaDirectivesDefinitions, autoSchema: this.graphQLAutoSchema, - mergeSchemas, + stitchSchemas, }); } else { - this.graphQLSchema = mergeSchemas({ + this.graphQLSchema = stitchSchemas({ schemas: [ this.graphQLSchemaDirectivesDefinitions, this.graphQLAutoSchema, diff --git a/src/GraphQL/loaders/schemaDirectives.js b/src/GraphQL/loaders/schemaDirectives.js index d8ff5ad5..f0366778 100644 --- a/src/GraphQL/loaders/schemaDirectives.js +++ b/src/GraphQL/loaders/schemaDirectives.js @@ -1,5 +1,5 @@ import gql from 'graphql-tag'; -import { SchemaDirectiveVisitor } from 'graphql-tools'; +import { SchemaDirectiveVisitor } from '@graphql-tools/utils'; import { FunctionsRouter } from '../../Routers/FunctionsRouter'; export const definitions = gql`