From 31a64714a3e47dc41b950b3e1cfd1a49e7ff2d8a Mon Sep 17 00:00:00 2001 From: Arda TANRIKULU Date: Thu, 29 Sep 2022 17:42:34 +0300 Subject: [PATCH] fix(runtime): fix memoization logic on batching (#4605) * fix(runtime): fix memoization logic on batching * Fix * chore(dependencies): updated changesets for modified dependencies * Cleanup * Go Co-authored-by: github-actions[bot] --- ...@graphql-mesh_graphql-4605-dependencies.md | 7 ++ ...esh_merger-federation-4605-dependencies.md | 5 ++ ...mesh_merger-stitching-4605-dependencies.md | 7 ++ .../@graphql-mesh_mysql-4605-dependencies.md | 5 ++ .../@graphql-mesh_odata-4605-dependencies.md | 5 ++ ...hql-mesh_postgraphile-4605-dependencies.md | 5 ++ ...@graphql-mesh_runtime-4605-dependencies.md | 7 ++ ...transform-encapsulate-4605-dependencies.md | 6 ++ ..._transform-federation-4605-dependencies.md | 6 ++ ...ansform-filter-schema-4605-dependencies.md | 6 ++ ...transform-hoist-field-4605-dependencies.md | 6 ++ ...orm-naming-convention-4605-dependencies.md | 6 ++ ...mesh_transform-prefix-4605-dependencies.md | 6 ++ ...mesh_transform-rename-4605-dependencies.md | 6 ++ ...ransform-type-merging-4605-dependencies.md | 6 ++ .../@graphql-mesh_types-4605-dependencies.md | 6 ++ .../@graphql-mesh_utils-4605-dependencies.md | 5 ++ .changeset/lovely-shirts-prove.md | 5 ++ .../__snapshots__/neo4j-example.test.js.snap | 2 +- examples/programmatic-batching/.meshrc.yml | 20 ++++++ .../additional-resolvers.ts | 26 +++++++ .../programmatic-batching/example-api/app.ts | 32 +++++++++ .../example-api/index.ts | 6 ++ .../example-api/openapi.json | 70 +++++++++++++++++++ .../example-query.graphql | 13 ++++ examples/programmatic-batching/package.json | 20 ++++++ .../programmatic-batching.spec.ts.snap | 45 ++++++++++++ .../tests/programmatic-batching.spec.ts | 45 ++++++++++++ examples/programmatic-batching/tsconfig.json | 11 +++ packages/handlers/graphql/package.json | 6 +- packages/handlers/mysql/package.json | 2 +- packages/handlers/odata/package.json | 2 +- packages/handlers/postgraphile/package.json | 2 +- packages/mergers/federation/package.json | 2 +- packages/mergers/stitching/package.json | 6 +- packages/runtime/package.json | 6 +- packages/runtime/src/in-context-sdk.ts | 45 ++++++++---- packages/transforms/encapsulate/package.json | 4 +- packages/transforms/federation/package.json | 4 +- .../transforms/filter-schema/package.json | 4 +- packages/transforms/hoist-field/package.json | 4 +- .../transforms/naming-convention/package.json | 4 +- packages/transforms/prefix/package.json | 4 +- packages/transforms/rate-limit/package.json | 2 +- packages/transforms/rename/package.json | 4 +- packages/transforms/type-merging/package.json | 4 +- packages/types/package.json | 4 +- packages/utils/package.json | 2 +- yarn.lock | 68 +++++++++--------- 49 files changed, 493 insertions(+), 81 deletions(-) create mode 100644 .changeset/@graphql-mesh_graphql-4605-dependencies.md create mode 100644 .changeset/@graphql-mesh_merger-federation-4605-dependencies.md create mode 100644 .changeset/@graphql-mesh_merger-stitching-4605-dependencies.md create mode 100644 .changeset/@graphql-mesh_mysql-4605-dependencies.md create mode 100644 .changeset/@graphql-mesh_odata-4605-dependencies.md create mode 100644 .changeset/@graphql-mesh_postgraphile-4605-dependencies.md create mode 100644 .changeset/@graphql-mesh_runtime-4605-dependencies.md create mode 100644 .changeset/@graphql-mesh_transform-encapsulate-4605-dependencies.md create mode 100644 .changeset/@graphql-mesh_transform-federation-4605-dependencies.md create mode 100644 .changeset/@graphql-mesh_transform-filter-schema-4605-dependencies.md create mode 100644 .changeset/@graphql-mesh_transform-hoist-field-4605-dependencies.md create mode 100644 .changeset/@graphql-mesh_transform-naming-convention-4605-dependencies.md create mode 100644 .changeset/@graphql-mesh_transform-prefix-4605-dependencies.md create mode 100644 .changeset/@graphql-mesh_transform-rename-4605-dependencies.md create mode 100644 .changeset/@graphql-mesh_transform-type-merging-4605-dependencies.md create mode 100644 .changeset/@graphql-mesh_types-4605-dependencies.md create mode 100644 .changeset/@graphql-mesh_utils-4605-dependencies.md create mode 100644 .changeset/lovely-shirts-prove.md create mode 100644 examples/programmatic-batching/.meshrc.yml create mode 100644 examples/programmatic-batching/additional-resolvers.ts create mode 100644 examples/programmatic-batching/example-api/app.ts create mode 100644 examples/programmatic-batching/example-api/index.ts create mode 100644 examples/programmatic-batching/example-api/openapi.json create mode 100644 examples/programmatic-batching/example-query.graphql create mode 100644 examples/programmatic-batching/package.json create mode 100644 examples/programmatic-batching/tests/__snapshots__/programmatic-batching.spec.ts.snap create mode 100644 examples/programmatic-batching/tests/programmatic-batching.spec.ts create mode 100644 examples/programmatic-batching/tsconfig.json diff --git a/.changeset/@graphql-mesh_graphql-4605-dependencies.md b/.changeset/@graphql-mesh_graphql-4605-dependencies.md new file mode 100644 index 0000000000000..7069440b13b6b --- /dev/null +++ b/.changeset/@graphql-mesh_graphql-4605-dependencies.md @@ -0,0 +1,7 @@ +--- +"@graphql-mesh/graphql": patch +--- +dependencies updates: + - Updated dependency [`@graphql-tools/url-loader@7.16.4` ↗︎](https://www.npmjs.com/package/@graphql-tools/url-loader/v/7.16.4) (from `7.16.2`, in `dependencies`) + - Updated dependency [`@graphql-tools/wrap@9.2.3` ↗︎](https://www.npmjs.com/package/@graphql-tools/wrap/v/9.2.3) (from `9.2.1`, in `dependencies`) + - Updated dependency [`@graphql-tools/delegate@9.0.8` ↗︎](https://www.npmjs.com/package/@graphql-tools/delegate/v/9.0.8) (from `9.0.6`, in `dependencies`) diff --git a/.changeset/@graphql-mesh_merger-federation-4605-dependencies.md b/.changeset/@graphql-mesh_merger-federation-4605-dependencies.md new file mode 100644 index 0000000000000..c689c2507d09f --- /dev/null +++ b/.changeset/@graphql-mesh_merger-federation-4605-dependencies.md @@ -0,0 +1,5 @@ +--- +"@graphql-mesh/merger-federation": patch +--- +dependencies updates: + - Updated dependency [`@graphql-tools/wrap@9.2.3` ↗︎](https://www.npmjs.com/package/@graphql-tools/wrap/v/9.2.3) (from `9.2.1`, in `dependencies`) diff --git a/.changeset/@graphql-mesh_merger-stitching-4605-dependencies.md b/.changeset/@graphql-mesh_merger-stitching-4605-dependencies.md new file mode 100644 index 0000000000000..f3a24d370dbb0 --- /dev/null +++ b/.changeset/@graphql-mesh_merger-stitching-4605-dependencies.md @@ -0,0 +1,7 @@ +--- +"@graphql-mesh/merger-stitching": patch +--- +dependencies updates: + - Updated dependency [`@graphql-tools/stitch@8.7.13` ↗︎](https://www.npmjs.com/package/@graphql-tools/stitch/v/8.7.13) (from `8.7.11`, in `dependencies`) + - Updated dependency [`@graphql-tools/delegate@9.0.8` ↗︎](https://www.npmjs.com/package/@graphql-tools/delegate/v/9.0.8) (from `9.0.6`, in `dependencies`) + - Updated dependency [`@graphql-tools/stitching-directives@2.3.11` ↗︎](https://www.npmjs.com/package/@graphql-tools/stitching-directives/v/2.3.11) (from `2.3.9`, in `dependencies`) diff --git a/.changeset/@graphql-mesh_mysql-4605-dependencies.md b/.changeset/@graphql-mesh_mysql-4605-dependencies.md new file mode 100644 index 0000000000000..cb33ac499d932 --- /dev/null +++ b/.changeset/@graphql-mesh_mysql-4605-dependencies.md @@ -0,0 +1,5 @@ +--- +"@graphql-mesh/mysql": patch +--- +dependencies updates: + - Updated dependency [`@graphql-tools/delegate@9.0.8` ↗︎](https://www.npmjs.com/package/@graphql-tools/delegate/v/9.0.8) (from `9.0.6`, in `dependencies`) diff --git a/.changeset/@graphql-mesh_odata-4605-dependencies.md b/.changeset/@graphql-mesh_odata-4605-dependencies.md new file mode 100644 index 0000000000000..55b200f1ab3f9 --- /dev/null +++ b/.changeset/@graphql-mesh_odata-4605-dependencies.md @@ -0,0 +1,5 @@ +--- +"@graphql-mesh/odata": patch +--- +dependencies updates: + - Updated dependency [`@graphql-tools/delegate@9.0.8` ↗︎](https://www.npmjs.com/package/@graphql-tools/delegate/v/9.0.8) (from `9.0.6`, in `dependencies`) diff --git a/.changeset/@graphql-mesh_postgraphile-4605-dependencies.md b/.changeset/@graphql-mesh_postgraphile-4605-dependencies.md new file mode 100644 index 0000000000000..160d460b0f9e8 --- /dev/null +++ b/.changeset/@graphql-mesh_postgraphile-4605-dependencies.md @@ -0,0 +1,5 @@ +--- +"@graphql-mesh/postgraphile": patch +--- +dependencies updates: + - Updated dependency [`@graphql-tools/delegate@9.0.8` ↗︎](https://www.npmjs.com/package/@graphql-tools/delegate/v/9.0.8) (from `9.0.6`, in `dependencies`) diff --git a/.changeset/@graphql-mesh_runtime-4605-dependencies.md b/.changeset/@graphql-mesh_runtime-4605-dependencies.md new file mode 100644 index 0000000000000..4b17e7250c7fa --- /dev/null +++ b/.changeset/@graphql-mesh_runtime-4605-dependencies.md @@ -0,0 +1,7 @@ +--- +"@graphql-mesh/runtime": patch +--- +dependencies updates: + - Updated dependency [`@graphql-tools/delegate@9.0.8` ↗︎](https://www.npmjs.com/package/@graphql-tools/delegate/v/9.0.8) (from `9.0.6`, in `dependencies`) + - Updated dependency [`@graphql-tools/batch-delegate@8.4.1` ↗︎](https://www.npmjs.com/package/@graphql-tools/batch-delegate/v/8.4.1) (from `8.3.9`, in `dependencies`) + - Updated dependency [`@graphql-tools/wrap@9.2.3` ↗︎](https://www.npmjs.com/package/@graphql-tools/wrap/v/9.2.3) (from `9.2.1`, in `dependencies`) diff --git a/.changeset/@graphql-mesh_transform-encapsulate-4605-dependencies.md b/.changeset/@graphql-mesh_transform-encapsulate-4605-dependencies.md new file mode 100644 index 0000000000000..a3a6ae3254cfe --- /dev/null +++ b/.changeset/@graphql-mesh_transform-encapsulate-4605-dependencies.md @@ -0,0 +1,6 @@ +--- +"@graphql-mesh/transform-encapsulate": patch +--- +dependencies updates: + - Updated dependency [`@graphql-tools/delegate@9.0.8` ↗︎](https://www.npmjs.com/package/@graphql-tools/delegate/v/9.0.8) (from `9.0.6`, in `dependencies`) + - Updated dependency [`@graphql-tools/wrap@9.2.3` ↗︎](https://www.npmjs.com/package/@graphql-tools/wrap/v/9.2.3) (from `9.2.1`, in `dependencies`) diff --git a/.changeset/@graphql-mesh_transform-federation-4605-dependencies.md b/.changeset/@graphql-mesh_transform-federation-4605-dependencies.md new file mode 100644 index 0000000000000..3d5989c2c6695 --- /dev/null +++ b/.changeset/@graphql-mesh_transform-federation-4605-dependencies.md @@ -0,0 +1,6 @@ +--- +"@graphql-mesh/transform-federation": patch +--- +dependencies updates: + - Updated dependency [`@graphql-tools/stitching-directives@2.3.11` ↗︎](https://www.npmjs.com/package/@graphql-tools/stitching-directives/v/2.3.11) (from `2.3.9`, in `dependencies`) + - Updated dependency [`@graphql-tools/delegate@9.0.8` ↗︎](https://www.npmjs.com/package/@graphql-tools/delegate/v/9.0.8) (from `9.0.6`, in `dependencies`) diff --git a/.changeset/@graphql-mesh_transform-filter-schema-4605-dependencies.md b/.changeset/@graphql-mesh_transform-filter-schema-4605-dependencies.md new file mode 100644 index 0000000000000..25272a6aca2fc --- /dev/null +++ b/.changeset/@graphql-mesh_transform-filter-schema-4605-dependencies.md @@ -0,0 +1,6 @@ +--- +"@graphql-mesh/transform-filter-schema": patch +--- +dependencies updates: + - Updated dependency [`@graphql-tools/wrap@9.2.3` ↗︎](https://www.npmjs.com/package/@graphql-tools/wrap/v/9.2.3) (from `9.2.1`, in `dependencies`) + - Updated dependency [`@graphql-tools/delegate@9.0.8` ↗︎](https://www.npmjs.com/package/@graphql-tools/delegate/v/9.0.8) (from `9.0.6`, in `dependencies`) diff --git a/.changeset/@graphql-mesh_transform-hoist-field-4605-dependencies.md b/.changeset/@graphql-mesh_transform-hoist-field-4605-dependencies.md new file mode 100644 index 0000000000000..38ad863834823 --- /dev/null +++ b/.changeset/@graphql-mesh_transform-hoist-field-4605-dependencies.md @@ -0,0 +1,6 @@ +--- +"@graphql-mesh/transform-hoist-field": patch +--- +dependencies updates: + - Updated dependency [`@graphql-tools/delegate@9.0.8` ↗︎](https://www.npmjs.com/package/@graphql-tools/delegate/v/9.0.8) (from `9.0.6`, in `dependencies`) + - Updated dependency [`@graphql-tools/wrap@9.2.3` ↗︎](https://www.npmjs.com/package/@graphql-tools/wrap/v/9.2.3) (from `9.2.1`, in `dependencies`) diff --git a/.changeset/@graphql-mesh_transform-naming-convention-4605-dependencies.md b/.changeset/@graphql-mesh_transform-naming-convention-4605-dependencies.md new file mode 100644 index 0000000000000..4d4d10bd33839 --- /dev/null +++ b/.changeset/@graphql-mesh_transform-naming-convention-4605-dependencies.md @@ -0,0 +1,6 @@ +--- +"@graphql-mesh/transform-naming-convention": patch +--- +dependencies updates: + - Updated dependency [`@graphql-tools/delegate@9.0.8` ↗︎](https://www.npmjs.com/package/@graphql-tools/delegate/v/9.0.8) (from `9.0.6`, in `dependencies`) + - Updated dependency [`@graphql-tools/wrap@9.2.3` ↗︎](https://www.npmjs.com/package/@graphql-tools/wrap/v/9.2.3) (from `9.2.1`, in `dependencies`) diff --git a/.changeset/@graphql-mesh_transform-prefix-4605-dependencies.md b/.changeset/@graphql-mesh_transform-prefix-4605-dependencies.md new file mode 100644 index 0000000000000..c74ca914b98a1 --- /dev/null +++ b/.changeset/@graphql-mesh_transform-prefix-4605-dependencies.md @@ -0,0 +1,6 @@ +--- +"@graphql-mesh/transform-prefix": patch +--- +dependencies updates: + - Updated dependency [`@graphql-tools/delegate@9.0.8` ↗︎](https://www.npmjs.com/package/@graphql-tools/delegate/v/9.0.8) (from `9.0.6`, in `dependencies`) + - Updated dependency [`@graphql-tools/wrap@9.2.3` ↗︎](https://www.npmjs.com/package/@graphql-tools/wrap/v/9.2.3) (from `9.2.1`, in `dependencies`) diff --git a/.changeset/@graphql-mesh_transform-rename-4605-dependencies.md b/.changeset/@graphql-mesh_transform-rename-4605-dependencies.md new file mode 100644 index 0000000000000..70b18d7698447 --- /dev/null +++ b/.changeset/@graphql-mesh_transform-rename-4605-dependencies.md @@ -0,0 +1,6 @@ +--- +"@graphql-mesh/transform-rename": patch +--- +dependencies updates: + - Updated dependency [`@graphql-tools/delegate@9.0.8` ↗︎](https://www.npmjs.com/package/@graphql-tools/delegate/v/9.0.8) (from `9.0.6`, in `dependencies`) + - Updated dependency [`@graphql-tools/wrap@9.2.3` ↗︎](https://www.npmjs.com/package/@graphql-tools/wrap/v/9.2.3) (from `9.2.1`, in `dependencies`) diff --git a/.changeset/@graphql-mesh_transform-type-merging-4605-dependencies.md b/.changeset/@graphql-mesh_transform-type-merging-4605-dependencies.md new file mode 100644 index 0000000000000..fed255f9750a9 --- /dev/null +++ b/.changeset/@graphql-mesh_transform-type-merging-4605-dependencies.md @@ -0,0 +1,6 @@ +--- +"@graphql-mesh/transform-type-merging": patch +--- +dependencies updates: + - Updated dependency [`@graphql-tools/stitching-directives@2.3.11` ↗︎](https://www.npmjs.com/package/@graphql-tools/stitching-directives/v/2.3.11) (from `2.3.9`, in `dependencies`) + - Updated dependency [`@graphql-tools/delegate@9.0.8` ↗︎](https://www.npmjs.com/package/@graphql-tools/delegate/v/9.0.8) (from `9.0.6`, in `dependencies`) diff --git a/.changeset/@graphql-mesh_types-4605-dependencies.md b/.changeset/@graphql-mesh_types-4605-dependencies.md new file mode 100644 index 0000000000000..3ef93a358c8ec --- /dev/null +++ b/.changeset/@graphql-mesh_types-4605-dependencies.md @@ -0,0 +1,6 @@ +--- +"@graphql-mesh/types": patch +--- +dependencies updates: + - Updated dependency [`@graphql-tools/batch-delegate@8.4.1` ↗︎](https://www.npmjs.com/package/@graphql-tools/batch-delegate/v/8.4.1) (from `8.3.9`, in `dependencies`) + - Updated dependency [`@graphql-tools/delegate@9.0.8` ↗︎](https://www.npmjs.com/package/@graphql-tools/delegate/v/9.0.8) (from `9.0.6`, in `dependencies`) diff --git a/.changeset/@graphql-mesh_utils-4605-dependencies.md b/.changeset/@graphql-mesh_utils-4605-dependencies.md new file mode 100644 index 0000000000000..72a28cf2b8526 --- /dev/null +++ b/.changeset/@graphql-mesh_utils-4605-dependencies.md @@ -0,0 +1,5 @@ +--- +"@graphql-mesh/utils": patch +--- +dependencies updates: + - Updated dependency [`@graphql-tools/delegate@9.0.8` ↗︎](https://www.npmjs.com/package/@graphql-tools/delegate/v/9.0.8) (from `9.0.6`, in `dependencies`) diff --git a/.changeset/lovely-shirts-prove.md b/.changeset/lovely-shirts-prove.md new file mode 100644 index 0000000000000..953e29289cbcc --- /dev/null +++ b/.changeset/lovely-shirts-prove.md @@ -0,0 +1,5 @@ +--- +'@graphql-mesh/runtime': patch +--- + +Fix memoization on batch delegation diff --git a/examples/neo4j-example/tests/__snapshots__/neo4j-example.test.js.snap b/examples/neo4j-example/tests/__snapshots__/neo4j-example.test.js.snap index 56da2c6919c99..99dd04b3c88d1 100644 --- a/examples/neo4j-example/tests/__snapshots__/neo4j-example.test.js.snap +++ b/examples/neo4j-example/tests/__snapshots__/neo4j-example.test.js.snap @@ -2829,7 +2829,7 @@ exports[`Neo4j should give correct response for example queries: example-query.g "released": 1999n, "tagline": "Welcome to the Real World", "title": "The Matrix", - "votes": 2494n, + "votes": 2507n, }, { "peopleActedIn": [ diff --git a/examples/programmatic-batching/.meshrc.yml b/examples/programmatic-batching/.meshrc.yml new file mode 100644 index 0000000000000..20458d87f0492 --- /dev/null +++ b/examples/programmatic-batching/.meshrc.yml @@ -0,0 +1,20 @@ +sources: + - name: ExampleAPI + handler: + openapi: + baseUrl: http://localhost:4001 + source: ./example-api/openapi.json + +additionalTypeDefs: | + extend type Query { + user(id: Float!): User + } + +additionalResolvers: + - ./additional-resolvers.ts + +serve: + browser: false + +documents: + - ./example-query.graphql diff --git a/examples/programmatic-batching/additional-resolvers.ts b/examples/programmatic-batching/additional-resolvers.ts new file mode 100644 index 0000000000000..5be95217e6f31 --- /dev/null +++ b/examples/programmatic-batching/additional-resolvers.ts @@ -0,0 +1,26 @@ +import { print } from 'graphql'; +import { Resolvers } from './.mesh'; + +export const resolvers: Resolvers = { + Query: { + user(root, args, context, info) { + return context.ExampleAPI.Mutation.usersByIds({ + root, + context, + info, + // Key for the following batched request + key: args.id, + // Arguments for the following batched request + argsFromKeys: ids => ({ input: { ids } }), + // Function to extract the result from the batched response + valuesFromResults: data => data.results, + // Function to generate the selectionSet for the batched request + selectionSet: userSelectionSet => /* GraphQL */ ` + { + results ${print(userSelectionSet)} # Will print something like { id name } + } + `, + }); + }, + }, +}; diff --git a/examples/programmatic-batching/example-api/app.ts b/examples/programmatic-batching/example-api/app.ts new file mode 100644 index 0000000000000..74e9285cefa9d --- /dev/null +++ b/examples/programmatic-batching/example-api/app.ts @@ -0,0 +1,32 @@ +import { Router } from 'itty-router'; +import { createServerAdapter } from '@whatwg-node/server'; +import { Response } from '@whatwg-node/fetch'; + +export function createApp() { + const app = createServerAdapter(Router()); + + const users = [ + { id: 1, name: 'John Doe' }, + { id: 2, name: 'Jane Doe' }, + { id: 3, name: 'John Smith' }, + { id: 4, name: 'Jane Smith' }, + ]; + + app.post('/users_by_ids', async (req: Request) => { + const body = await req.json(); + const ids = body.ids; + const results = users.filter(user => ids.includes(user.id)); + return new Response( + JSON.stringify({ + results, + }), + { + headers: { + 'Content-Type': 'application/json', + }, + } + ); + }); + + return app; +} diff --git a/examples/programmatic-batching/example-api/index.ts b/examples/programmatic-batching/example-api/index.ts new file mode 100644 index 0000000000000..1dc84e08e0652 --- /dev/null +++ b/examples/programmatic-batching/example-api/index.ts @@ -0,0 +1,6 @@ +import { createServer } from 'http'; +import { createApp } from './app'; + +createServer(createApp()).listen(4001, () => { + console.log('Listening on port 4001'); +}); diff --git a/examples/programmatic-batching/example-api/openapi.json b/examples/programmatic-batching/example-api/openapi.json new file mode 100644 index 0000000000000..48bdd0c7b4a00 --- /dev/null +++ b/examples/programmatic-batching/example-api/openapi.json @@ -0,0 +1,70 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "API Name", + "version": "1.0" + }, + "paths": { + "/users_by_ids": { + "post": { + "operationId": "usersByIds", + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "UsersByIdRequest", + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "number" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsersByIdResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "UsersByIdResponse": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "User": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + } + } + } + } +} diff --git a/examples/programmatic-batching/example-query.graphql b/examples/programmatic-batching/example-query.graphql new file mode 100644 index 0000000000000..7370ea70d2767 --- /dev/null +++ b/examples/programmatic-batching/example-query.graphql @@ -0,0 +1,13 @@ +fragment UserF on User { + id + name +} + +{ + john: user(id: 1) { + ...UserF + } + jane: user(id: 2) { + ...UserF + } +} diff --git a/examples/programmatic-batching/package.json b/examples/programmatic-batching/package.json new file mode 100644 index 0000000000000..1171ca49dfe7e --- /dev/null +++ b/examples/programmatic-batching/package.json @@ -0,0 +1,20 @@ +{ + "name": "programmatic-batching-example", + "version": "0.0.0", + "license": "MIT", + "private": true, + "scripts": { + "start:mesh": "mesh dev", + "start:api": "ts-node example-api/index.ts" + }, + "dependencies": { + "@graphql-mesh/cli": "0.78.25", + "@graphql-mesh/openapi": "0.33.20", + "graphql": "16.6.0" + }, + "devDependencies": { + "jest": "29.0.3", + "concurrently": "7.4.0", + "ts-node": "10.9.1" + } +} diff --git a/examples/programmatic-batching/tests/__snapshots__/programmatic-batching.spec.ts.snap b/examples/programmatic-batching/tests/__snapshots__/programmatic-batching.spec.ts.snap new file mode 100644 index 0000000000000..8d31b96eaf42d --- /dev/null +++ b/examples/programmatic-batching/tests/__snapshots__/programmatic-batching.spec.ts.snap @@ -0,0 +1,45 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Batching Example should generate correct schema 1`] = ` +"schema { + query: Query + mutation: Mutation +} + +type Mutation { + usersByIds(input: UsersByIdRequest_Input): UsersByIdResponse +} + +type Query { + dummy: String + user(id: Float!): User +} + +type User { + id: String + name: String +} + +input UsersByIdRequest_Input { + ids: [Float] +} + +type UsersByIdResponse { + results: [User] +}" +`; + +exports[`Batching Example should give correct response for the batched example query: example-query-result 1`] = ` +{ + "data": { + "jane": { + "id": "2", + "name": "Jane Doe", + }, + "john": { + "id": "1", + "name": "John Doe", + }, + }, +} +`; diff --git a/examples/programmatic-batching/tests/programmatic-batching.spec.ts b/examples/programmatic-batching/tests/programmatic-batching.spec.ts new file mode 100644 index 0000000000000..951625d96fa01 --- /dev/null +++ b/examples/programmatic-batching/tests/programmatic-batching.spec.ts @@ -0,0 +1,45 @@ +import { findAndParseConfig } from '@graphql-mesh/cli'; +import { getMesh, MeshInstance } from '@graphql-mesh/runtime'; +import { basename, join } from 'path'; + +import { lexicographicSortSchema } from 'graphql'; +import { loadDocuments } from '@graphql-tools/load'; +import { GraphQLFileLoader } from '@graphql-tools/graphql-file-loader'; +import { printSchemaWithDirectives } from '@graphql-tools/utils'; +import { createApp } from '../example-api/app'; +import { createServer, Server } from 'http'; +import { ProcessedConfig } from '@graphql-mesh/config'; +import { readFile } from 'fs/promises'; + +describe('Batching Example', () => { + let config: ProcessedConfig; + let mesh: MeshInstance; + beforeAll(async () => { + config = await findAndParseConfig({ + dir: join(__dirname, '..'), + }); + const app = createApp(); + config.logger = { + info: () => {}, + error: () => {}, + warn: () => {}, + debug: () => {}, + log: () => {}, + child: () => config.logger, + }; + config.fetchFn = jest.fn(async (url, options) => app.fetch(url, options)); + mesh = await getMesh(config); + }); + afterAll(() => { + mesh.destroy(); + }); + it('should generate correct schema', () => { + expect(printSchemaWithDirectives(lexicographicSortSchema(mesh.schema))).toMatchSnapshot(); + }); + it('should give correct response for the batched example query', async () => { + const queryStr = await readFile(join(__dirname, '..', 'example-query.graphql'), 'utf-8'); + const result = await mesh.execute(queryStr, {}); + expect(result).toMatchSnapshot('example-query-result'); + expect(config.fetchFn).toHaveBeenCalledTimes(1); + }); +}); diff --git a/examples/programmatic-batching/tsconfig.json b/examples/programmatic-batching/tsconfig.json new file mode 100644 index 0000000000000..b508f51b2006d --- /dev/null +++ b/examples/programmatic-batching/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "target": "esnext", + "module": "commonjs", + "moduleResolution": "node", + "lib": ["esnext"], + "esModuleInterop": true, + "allowSyntheticDefaultImports": true + }, + "exclude": ["node_modules"] +} diff --git a/packages/handlers/graphql/package.json b/packages/handlers/graphql/package.json index 8a91c4d3107d9..d39228ded93af 100644 --- a/packages/handlers/graphql/package.json +++ b/packages/handlers/graphql/package.json @@ -33,9 +33,9 @@ "@graphql-mesh/string-interpolation": "0.3.2", "@graphql-mesh/utils": "0.41.16", "@graphql-mesh/types": "0.84.5", - "@graphql-tools/url-loader": "7.16.2", - "@graphql-tools/wrap": "9.2.1", - "@graphql-tools/delegate": "9.0.6", + "@graphql-tools/url-loader": "7.16.4", + "@graphql-tools/wrap": "9.2.3", + "@graphql-tools/delegate": "9.0.8", "@graphql-tools/utils": "8.12.0", "lodash.get": "4.4.2", "tslib": "^2.4.0" diff --git a/packages/handlers/mysql/package.json b/packages/handlers/mysql/package.json index f6bb66086ff44..f03411ee9db86 100644 --- a/packages/handlers/mysql/package.json +++ b/packages/handlers/mysql/package.json @@ -43,7 +43,7 @@ "graphql-scalars": "1.18.0", "tslib": "^2.4.0", "@graphql-tools/utils": "8.12.0", - "@graphql-tools/delegate": "9.0.6" + "@graphql-tools/delegate": "9.0.8" }, "devDependencies": { "@types/graphql-fields": "1.3.4", diff --git a/packages/handlers/odata/package.json b/packages/handlers/odata/package.json index fef3b5389b72d..c7b335b6dfafe 100644 --- a/packages/handlers/odata/package.json +++ b/packages/handlers/odata/package.json @@ -48,7 +48,7 @@ "pascal-case": "3.1.2", "url-join": "4.0.1", "tslib": "^2.4.0", - "@graphql-tools/delegate": "9.0.6" + "@graphql-tools/delegate": "9.0.8" }, "publishConfig": { "access": "public", diff --git a/packages/handlers/postgraphile/package.json b/packages/handlers/postgraphile/package.json index c2999faeec89a..5b7b4d3296a10 100644 --- a/packages/handlers/postgraphile/package.json +++ b/packages/handlers/postgraphile/package.json @@ -37,7 +37,7 @@ "postgraphile": "4.12.11", "pg": "^8.6.0", "tslib": "^2.4.0", - "@graphql-tools/delegate": "9.0.6" + "@graphql-tools/delegate": "9.0.8" }, "publishConfig": { "access": "public", diff --git a/packages/mergers/federation/package.json b/packages/mergers/federation/package.json index 3155453b6de44..d7d87b8a89cc1 100644 --- a/packages/mergers/federation/package.json +++ b/packages/mergers/federation/package.json @@ -29,7 +29,7 @@ }, "dependencies": { "@graphql-mesh/types": "0.84.5", - "@graphql-tools/wrap": "9.2.1", + "@graphql-tools/wrap": "9.2.3", "@apollo/gateway": "2.1.3", "@graphql-tools/schema": "9.0.4", "@graphql-mesh/cross-helpers": "0.2.6", diff --git a/packages/mergers/stitching/package.json b/packages/mergers/stitching/package.json index c12b5c6a763c5..8efd6d8932a8f 100644 --- a/packages/mergers/stitching/package.json +++ b/packages/mergers/stitching/package.json @@ -29,10 +29,10 @@ }, "dependencies": { "@graphql-mesh/types": "0.84.5", - "@graphql-tools/stitch": "8.7.11", + "@graphql-tools/stitch": "8.7.13", "@graphql-mesh/utils": "0.41.16", - "@graphql-tools/delegate": "9.0.6", - "@graphql-tools/stitching-directives": "2.3.9", + "@graphql-tools/delegate": "9.0.8", + "@graphql-tools/stitching-directives": "2.3.11", "@graphql-tools/schema": "9.0.4", "@graphql-mesh/store": "0.8.49", "@graphql-tools/utils": "8.12.0", diff --git a/packages/runtime/package.json b/packages/runtime/package.json index 243aa0d2fc4c1..f592178e6337b 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -32,10 +32,10 @@ "@graphql-mesh/types": "0.84.5", "@graphql-mesh/utils": "0.41.16", "@graphql-mesh/string-interpolation": "0.3.2", - "@graphql-tools/delegate": "9.0.6", - "@graphql-tools/batch-delegate": "8.3.9", + "@graphql-tools/delegate": "9.0.8", + "@graphql-tools/batch-delegate": "8.4.1", "@graphql-tools/batch-execute": "8.5.6", - "@graphql-tools/wrap": "9.2.1", + "@graphql-tools/wrap": "9.2.3", "@graphql-tools/utils": "8.12.0", "fetchache": "0.1.4", "@whatwg-node/fetch": "^0.4.6", diff --git a/packages/runtime/src/in-context-sdk.ts b/packages/runtime/src/in-context-sdk.ts index 0a47425e2cf9c..76706277c1f4d 100644 --- a/packages/runtime/src/in-context-sdk.ts +++ b/packages/runtime/src/in-context-sdk.ts @@ -6,10 +6,10 @@ import { SelectionSetParam, SelectionSetParamOrFactory, } from '@graphql-mesh/types'; -import { printWithCache } from '@graphql-mesh/utils'; +import { parseWithCache } from '@graphql-mesh/utils'; import { BatchDelegateOptions, batchDelegateToSchema } from '@graphql-tools/batch-delegate'; import { SubschemaConfig, StitchingInfo, IDelegateToSchemaOptions, delegateToSchema } from '@graphql-tools/delegate'; -import { parseSelectionSet, isDocumentNode } from '@graphql-tools/utils'; +import { isDocumentNode, memoize1 } from '@graphql-tools/utils'; import { WrapQuery } from '@graphql-tools/wrap'; import { GraphQLSchema, @@ -20,6 +20,8 @@ import { Kind, GraphQLResolveInfo, SelectionSetNode, + OperationDefinitionNode, + DocumentNode, } from 'graphql'; import { MESH_API_CONTEXT_SYMBOL } from './constants'; @@ -242,27 +244,44 @@ export async function getInContextSDK( return inContextSDK; } -function normalizeSelectionSetParam(selectionSetParam: SelectionSetParam) { +function getSelectionSetFromDocumentNode(documentNode: DocumentNode): SelectionSetNode { + const operationDefinition = documentNode.definitions.find( + definition => definition.kind === Kind.OPERATION_DEFINITION + ) as OperationDefinitionNode; + if (!operationDefinition) { + throw new Error('DocumentNode must contain an OperationDefinitionNode'); + } + return operationDefinition.selectionSet; +} + +function normalizeSelectionSetParam(selectionSetParam: SelectionSetParam): SelectionSetNode { if (typeof selectionSetParam === 'string') { - return parseSelectionSet(selectionSetParam); + const documentNode = parseWithCache(selectionSetParam); + return getSelectionSetFromDocumentNode(documentNode); } if (isDocumentNode(selectionSetParam)) { - return parseSelectionSet(printWithCache(selectionSetParam)); + return getSelectionSetFromDocumentNode(selectionSetParam); } return selectionSetParam; } +const normalizeSelectionSetParamFactory = memoize1(function normalizeSelectionSetParamFactory( + selectionSetParamFactory: (subtree: SelectionSetNode) => SelectionSetParam +) { + const memoizedSelectionSetFactory = memoize1(selectionSetParamFactory); + return function selectionSetFactory(subtree: SelectionSetNode) { + const selectionSetParam = memoizedSelectionSetFactory(subtree); + return normalizeSelectionSetParam(selectionSetParam); + }; +}); + function normalizeSelectionSetParamOrFactory( selectionSetParamOrFactory: SelectionSetParamOrFactory ): (subtree: SelectionSetNode) => SelectionSetNode { - return function getSelectionSet(subtree: SelectionSetNode) { - if (typeof selectionSetParamOrFactory === 'function') { - const selectionSetParam = selectionSetParamOrFactory(subtree); - return normalizeSelectionSetParam(selectionSetParam); - } else { - return normalizeSelectionSetParam(selectionSetParamOrFactory); - } - }; + if (typeof selectionSetParamOrFactory === 'function') { + return normalizeSelectionSetParamFactory(selectionSetParamOrFactory); + } + return () => normalizeSelectionSetParam(selectionSetParamOrFactory); } function identical(val: T): T { diff --git a/packages/transforms/encapsulate/package.json b/packages/transforms/encapsulate/package.json index 6fe9f4f39d8e6..1eb8bead998fe 100644 --- a/packages/transforms/encapsulate/package.json +++ b/packages/transforms/encapsulate/package.json @@ -30,8 +30,8 @@ "dependencies": { "@graphql-mesh/types": "0.84.5", "@graphql-mesh/utils": "0.41.16", - "@graphql-tools/delegate": "9.0.6", - "@graphql-tools/wrap": "9.2.1", + "@graphql-tools/delegate": "9.0.8", + "@graphql-tools/wrap": "9.2.3", "@graphql-tools/utils": "8.12.0", "tslib": "^2.4.0" }, diff --git a/packages/transforms/federation/package.json b/packages/transforms/federation/package.json index 5bbe713a73e5d..cbdd2003254cf 100644 --- a/packages/transforms/federation/package.json +++ b/packages/transforms/federation/package.json @@ -33,8 +33,8 @@ "@graphql-mesh/utils": "0.41.16", "graphql-transform-federation": "2.2.0", "@graphql-tools/utils": "8.12.0", - "@graphql-tools/stitching-directives": "2.3.9", - "@graphql-tools/delegate": "9.0.6", + "@graphql-tools/stitching-directives": "2.3.11", + "@graphql-tools/delegate": "9.0.8", "tslib": "^2.4.0" }, "publishConfig": { diff --git a/packages/transforms/filter-schema/package.json b/packages/transforms/filter-schema/package.json index 614a1b5ce07a0..3ca73a7452f68 100644 --- a/packages/transforms/filter-schema/package.json +++ b/packages/transforms/filter-schema/package.json @@ -34,8 +34,8 @@ "@graphql-mesh/types": "0.84.5", "@graphql-mesh/utils": "0.41.16", "minimatch": "5.1.0", - "@graphql-tools/wrap": "9.2.1", - "@graphql-tools/delegate": "9.0.6", + "@graphql-tools/wrap": "9.2.3", + "@graphql-tools/delegate": "9.0.8", "@graphql-tools/utils": "8.12.0", "tslib": "^2.4.0" }, diff --git a/packages/transforms/hoist-field/package.json b/packages/transforms/hoist-field/package.json index bce420512a062..5597fcd02c1ad 100644 --- a/packages/transforms/hoist-field/package.json +++ b/packages/transforms/hoist-field/package.json @@ -30,8 +30,8 @@ "dependencies": { "@graphql-mesh/types": "0.84.5", "@graphql-mesh/utils": "0.41.16", - "@graphql-tools/delegate": "9.0.6", - "@graphql-tools/wrap": "9.2.1", + "@graphql-tools/wrap": "9.2.3", + "@graphql-tools/delegate": "9.0.8", "@graphql-tools/utils": "8.12.0" }, "devDependencies": { diff --git a/packages/transforms/naming-convention/package.json b/packages/transforms/naming-convention/package.json index 21e6026012f91..dad4a5db46611 100644 --- a/packages/transforms/naming-convention/package.json +++ b/packages/transforms/naming-convention/package.json @@ -34,9 +34,9 @@ "dependencies": { "@graphql-mesh/types": "0.84.5", "@graphql-mesh/utils": "0.41.16", - "@graphql-tools/delegate": "9.0.6", + "@graphql-tools/wrap": "9.2.3", + "@graphql-tools/delegate": "9.0.8", "@graphql-tools/utils": "8.12.0", - "@graphql-tools/wrap": "9.2.1", "change-case": "4.1.2", "graphql-scalars": "1.18.0", "lower-case": "2.0.2", diff --git a/packages/transforms/prefix/package.json b/packages/transforms/prefix/package.json index 3228d97d24de4..3891c43bebd24 100644 --- a/packages/transforms/prefix/package.json +++ b/packages/transforms/prefix/package.json @@ -30,8 +30,8 @@ "dependencies": { "@graphql-mesh/types": "0.84.5", "@graphql-mesh/utils": "0.41.16", - "@graphql-tools/delegate": "9.0.6", - "@graphql-tools/wrap": "9.2.1", + "@graphql-tools/wrap": "9.2.3", + "@graphql-tools/delegate": "9.0.8", "@graphql-tools/utils": "8.12.0", "graphql-scalars": "1.18.0", "tslib": "^2.4.0" diff --git a/packages/transforms/rate-limit/package.json b/packages/transforms/rate-limit/package.json index 54e833aee1e85..dda3e9f429e05 100644 --- a/packages/transforms/rate-limit/package.json +++ b/packages/transforms/rate-limit/package.json @@ -38,7 +38,7 @@ "devDependencies": { "@graphql-mesh/cache-localforage": "0.6.46", "@graphql-tools/schema": "9.0.4", - "@graphql-tools/wrap": "9.2.1" + "@graphql-tools/wrap": "9.2.3" }, "publishConfig": { "access": "public", diff --git a/packages/transforms/rename/package.json b/packages/transforms/rename/package.json index 18445960cacd0..5ab1dd6c8575a 100644 --- a/packages/transforms/rename/package.json +++ b/packages/transforms/rename/package.json @@ -34,8 +34,8 @@ "dependencies": { "@graphql-mesh/types": "0.84.5", "@graphql-mesh/utils": "0.41.16", - "@graphql-tools/delegate": "9.0.6", - "@graphql-tools/wrap": "9.2.1", + "@graphql-tools/wrap": "9.2.3", + "@graphql-tools/delegate": "9.0.8", "@graphql-tools/utils": "8.12.0", "tslib": "^2.4.0" }, diff --git a/packages/transforms/type-merging/package.json b/packages/transforms/type-merging/package.json index c2a6cacb34550..fc1ee1dc81533 100644 --- a/packages/transforms/type-merging/package.json +++ b/packages/transforms/type-merging/package.json @@ -29,8 +29,8 @@ }, "dependencies": { "@graphql-mesh/types": "0.84.5", - "@graphql-tools/stitching-directives": "2.3.9", - "@graphql-tools/delegate": "9.0.6", + "@graphql-tools/stitching-directives": "2.3.11", + "@graphql-tools/delegate": "9.0.8", "@graphql-mesh/utils": "0.41.16", "tslib": "^2.4.0" }, diff --git a/packages/types/package.json b/packages/types/package.json index 56aef455ee0a3..b5f011a88d7e5 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -28,9 +28,9 @@ "graphql": "*" }, "dependencies": { - "@graphql-tools/batch-delegate": "8.3.9", + "@graphql-tools/batch-delegate": "8.4.1", "@graphql-mesh/store": "0.8.49", - "@graphql-tools/delegate": "9.0.6", + "@graphql-tools/delegate": "9.0.8", "@graphql-tools/utils": "8.12.0", "@graphql-typed-document-node/core": "3.1.1", "tslib": "^2.4.0" diff --git a/packages/utils/package.json b/packages/utils/package.json index b834a94988517..caafa349ec5fd 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -35,7 +35,7 @@ }, "dependencies": { "@graphql-mesh/string-interpolation": "0.3.2", - "@graphql-tools/delegate": "9.0.6", + "@graphql-tools/delegate": "9.0.8", "@graphql-tools/utils": "8.12.0", "@graphql-mesh/cross-helpers": "0.2.6", "@graphql-mesh/types": "0.84.5", diff --git a/yarn.lock b/yarn.lock index 31cbbda43fc49..52fcd2bc361b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2309,12 +2309,12 @@ object-inspect "1.10.3" tslib "^2.0.0" -"@graphql-tools/batch-delegate@8.3.9": - version "8.3.9" - resolved "https://registry.yarnpkg.com/@graphql-tools/batch-delegate/-/batch-delegate-8.3.9.tgz#5a2579dc23c993e034629618ebc7b1abbde1994e" - integrity sha512-t2C2oDRBtPRKZZpU5O0RcTP9xnAV0XibTvGmlpInZW/4+AYiLfkNnFXj4ioQ9kt+oCHZCMT4WOy5nbwzV1dFkg== +"@graphql-tools/batch-delegate@8.4.1": + version "8.4.1" + resolved "https://registry.yarnpkg.com/@graphql-tools/batch-delegate/-/batch-delegate-8.4.1.tgz#e4757df8cb6e985fedbd6315a7b2721190b988ef" + integrity sha512-kbDY3p0JKEcIUwb5lCXX647oz07lXbvdfigyzD++Goi7RChutK03MmPKvrrgQwi0SFupRKy1tIJAlExlW83STw== dependencies: - "@graphql-tools/delegate" "9.0.6" + "@graphql-tools/delegate" "9.0.8" "@graphql-tools/utils" "8.12.0" dataloader "2.1.0" tslib "^2.4.0" @@ -2351,10 +2351,10 @@ is-promise "4.0.0" tslib "~2.0.1" -"@graphql-tools/delegate@9.0.6": - version "9.0.6" - resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-9.0.6.tgz#734c188520bd10952517319a165bcf46cad5a35f" - integrity sha512-HMA7rcJLQA3dJwWRG2271mRCdh0SLaK5+FPg+F7JIa3aF5fRdN4pVHNDaAjQeyKOQ2afjgjO5FvOyJwv/ve7Bg== +"@graphql-tools/delegate@9.0.8": + version "9.0.8" + resolved "https://registry.yarnpkg.com/@graphql-tools/delegate/-/delegate-9.0.8.tgz#aa792f419a041de0c6341eaecf9694cf6f16f76f" + integrity sha512-h+Uce0Np0eKj7wILOvlffRQ9jEQ4KelNXfqG8A2w+2sO2P6CbKsR7bJ4ch9lcUdCBbZ4Wg6L/K+1C4NRFfzbNw== dependencies: "@graphql-tools/batch-execute" "8.5.6" "@graphql-tools/schema" "9.0.4" @@ -2527,26 +2527,26 @@ tslib "^2.4.0" value-or-promise "1.0.11" -"@graphql-tools/stitch@8.7.11": - version "8.7.11" - resolved "https://registry.yarnpkg.com/@graphql-tools/stitch/-/stitch-8.7.11.tgz#1e34a4c0bb9abb37262b9243537379b342701e1a" - integrity sha512-5pGlppfEuAcj2qHhzP7CV2pBrBEP6kmHdx/6KDfyyx4uT3r3+0jRuN0fiPL9wAloCZkmpbD7Ugl4sTYhqcpBeQ== +"@graphql-tools/stitch@8.7.13": + version "8.7.13" + resolved "https://registry.yarnpkg.com/@graphql-tools/stitch/-/stitch-8.7.13.tgz#94f8445ae1367569d9680ad4db6738ca4d98816c" + integrity sha512-7bKJWT1vJJfg1GKiHd6c3GxdmCX1y4HiMw6nXKKad79wdYC9uxRSBOWFGaGbyIZBkCv4E5ptZioCn65NX+Fmkw== dependencies: - "@graphql-tools/batch-delegate" "8.3.9" - "@graphql-tools/delegate" "9.0.6" + "@graphql-tools/batch-delegate" "8.4.1" + "@graphql-tools/delegate" "9.0.8" "@graphql-tools/merge" "8.3.6" "@graphql-tools/schema" "9.0.4" "@graphql-tools/utils" "8.12.0" - "@graphql-tools/wrap" "9.2.1" + "@graphql-tools/wrap" "9.2.3" tslib "^2.4.0" value-or-promise "^1.0.11" -"@graphql-tools/stitching-directives@2.3.9": - version "2.3.9" - resolved "https://registry.yarnpkg.com/@graphql-tools/stitching-directives/-/stitching-directives-2.3.9.tgz#28241c283d4dad0d1bf9785aca436012c7f89467" - integrity sha512-qvvrgE9krB+ermCJdjz79E0GV9JZ0qYHCVXZNWSLk/gEFUe+4tBB1ECZbJWpEDyuRRjUuIm0W+vDhGUfeWGCTA== +"@graphql-tools/stitching-directives@2.3.11": + version "2.3.11" + resolved "https://registry.yarnpkg.com/@graphql-tools/stitching-directives/-/stitching-directives-2.3.11.tgz#8a3ae81f7a08a47579118e9bbac507108b6996af" + integrity sha512-Om1ApZXH5WUbaE4tKl1+5ZbxtFDKPJee4gIGbIQxFu7E/6p+Qoda4XSqjQoWDscZNgAtgxeICVMWGS6B9HqWzg== dependencies: - "@graphql-tools/delegate" "9.0.6" + "@graphql-tools/delegate" "9.0.8" "@graphql-tools/utils" "8.12.0" tslib "^2.4.0" @@ -2565,15 +2565,15 @@ valid-url "1.0.9" websocket "1.0.31" -"@graphql-tools/url-loader@7.16.2", "@graphql-tools/url-loader@^7.9.7": - version "7.16.2" - resolved "https://registry.yarnpkg.com/@graphql-tools/url-loader/-/url-loader-7.16.2.tgz#4b4d9db94262aa405bca0f4b9ccd381012a9de12" - integrity sha512-ZVG3kDEJ88zLfqYtVmI36RUzaP/0bPBcJfBH8whMYL620tE6kizEQsON8iKsxcU1bWB5D7m9ZVFqW4eZ5EqVWw== +"@graphql-tools/url-loader@7.16.4", "@graphql-tools/url-loader@^7.9.7": + version "7.16.4" + resolved "https://registry.yarnpkg.com/@graphql-tools/url-loader/-/url-loader-7.16.4.tgz#d27787ef9f35fe71b456c067c3a1759b1ecd76a8" + integrity sha512-7yGrJJNcqVQIplCyVLk7tW2mAgYyZ06FRmCBnzw3B61+aIjFavrm6YlnKkhdqYSYyFmIbVcigdP3vkoYIu23TA== dependencies: "@ardatan/sync-fetch" "0.0.1" - "@graphql-tools/delegate" "9.0.6" + "@graphql-tools/delegate" "9.0.8" "@graphql-tools/utils" "8.12.0" - "@graphql-tools/wrap" "9.2.1" + "@graphql-tools/wrap" "9.2.3" "@types/ws" "^8.0.0" "@whatwg-node/fetch" "^0.4.0" dset "^3.1.2" @@ -2626,12 +2626,12 @@ is-promise "4.0.0" tslib "~2.0.1" -"@graphql-tools/wrap@9.2.1": - version "9.2.1" - resolved "https://registry.yarnpkg.com/@graphql-tools/wrap/-/wrap-9.2.1.tgz#bc6558d31125b20acf1f4640eaa45b145a1c7a90" - integrity sha512-W8bzJijTZDNi8e1oM2AMG89CtvfTYaJ9lCe0dYMN+a+OPMhRfgR9+eO7ALcUa9y4MTu+YEDVjUq0ZboaSvesyA== +"@graphql-tools/wrap@9.2.3": + version "9.2.3" + resolved "https://registry.yarnpkg.com/@graphql-tools/wrap/-/wrap-9.2.3.tgz#70f7602aed9781fbc860cea64a918636599883be" + integrity sha512-aiLjcAuUwcvA1mF25c7KFDPXEdQDpo6bTDyAMCSlFXpF4T01hoxLERmfmbRmsmy/dP80ZB31a+t70aspVdqZSA== dependencies: - "@graphql-tools/delegate" "9.0.6" + "@graphql-tools/delegate" "9.0.8" "@graphql-tools/schema" "9.0.4" "@graphql-tools/utils" "8.12.0" tslib "^2.4.0" @@ -11261,7 +11261,7 @@ http-deceiver@^1.2.7: resolved "https://registry.yarnpkg.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" integrity sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc= -http-errors@1.6.2, http-errors@^1.5.1, http-errors@~1.6.2: +http-errors@1.6.2, http-errors@~1.6.2: version "1.6.2" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.2.tgz#0a002cc85707192a7e7946ceedc11155f60ec736" integrity sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY= @@ -11282,7 +11282,7 @@ http-errors@2.0.0: statuses "2.0.1" toidentifier "1.0.1" -http-errors@^1.7.3: +http-errors@^1.5.1, http-errors@^1.7.3: version "1.7.3" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==