Skip to content

Commit

Permalink
upgrade graphql-tools to v6 (#6701)
Browse files Browse the repository at this point in the history
* upgrade to v6

* remove old graphql-tools package

Co-authored-by: Antonio Davi Macedo Coelho de Castro <adavimacedo@gmail.com>
  • Loading branch information
yaacovCR and davimacedo authored May 25, 2020
1 parent ddf99a1 commit f56049b
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 42 deletions.
154 changes: 120 additions & 34 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions spec/ParseGraphQLServer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 5 additions & 4 deletions src/GraphQL/ParseGraphQLSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -251,7 +252,7 @@ class ParseGraphQLSchema {
}
}
);
this.graphQLSchema = mergeSchemas({
this.graphQLSchema = stitchSchemas({
schemas: [
this.graphQLSchemaDirectivesDefinitions,
this.graphQLAutoSchema,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQL/loaders/schemaDirectives.js
Original file line number Diff line number Diff line change
@@ -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`
Expand Down

0 comments on commit f56049b

Please sign in to comment.