From 7ed082a999354ef8fb0d69578d01c3f6dca68964 Mon Sep 17 00:00:00 2001 From: Damini Vashishtha Date: Mon, 8 Jul 2024 10:42:13 +0530 Subject: [PATCH] PREAPPS-7866 upgrade graphql version 15.8.0 to 16.9.0 --- package-lock.json | 6 +++--- package.json | 2 +- src/apollo/local-batch-link.ts | 18 +++++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1069e193..989147cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6198,9 +6198,9 @@ "dev": true }, "graphql": { - "version": "15.8.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.8.0.tgz", - "integrity": "sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==" + "version": "16.9.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.9.0.tgz", + "integrity": "sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw==" }, "graphql-config": { "version": "4.5.0", diff --git a/package.json b/package.json index bf503191..81c2fea4 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "@apollo/client": "3.4.16", "@graphql-tools/schema": "^10.0.3", "dataloader": "^2.2.2", - "graphql": "^15.8.0", + "graphql": "^16.9.0", "lodash": "^4.17.21", "mitt": "^3.0.0" }, diff --git a/src/apollo/local-batch-link.ts b/src/apollo/local-batch-link.ts index e0b1370d..bbd9427a 100644 --- a/src/apollo/local-batch-link.ts +++ b/src/apollo/local-batch-link.ts @@ -24,17 +24,17 @@ export class LocalBatchLink extends ApolloLink { let emittedResponse = false; Promise.all( operations.map((operation: Operation) => { - const query = print(operation.query); const { operationName, variables = {} } = operation; + const params = { + schema: this.schema, + source: print(operation.query), + rootValue: null, + contextValue: operation.getContext() || options.context || {}, + variableValues: variables, + operationName: operationName + }; - return graphql( - this.schema, - query, - null, - operation.getContext() || options.context || {}, - variables, - operationName - ); + return graphql(params); }) ) .then((results: FetchResult[]) => {