UNPKG

@graphql-tools/federation

Version:

Useful tools to create and manipulate GraphQL schemas.

1,250 lines (925 loc) 74.5 kB
# @graphql-tools/federation ## 3.1.7 ### Patch Changes - [#532](https://github.com/graphql-hive/gateway/pull/532) [`4e33933`](https://github.com/graphql-hive/gateway/commit/4e339333945f4c4547d9ae719e67b4671fe89f04) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - dependencies updates: - Updated dependency [`@whatwg-node/promise-helpers@^1.3.0` ↗︎](https://www.npmjs.com/package/@whatwg-node/promise-helpers/v/1.3.0) (from `^1.2.5`, in `dependencies`) - Updated dependencies [[`4e33933`](https://github.com/graphql-hive/gateway/commit/4e339333945f4c4547d9ae719e67b4671fe89f04), [`4e33933`](https://github.com/graphql-hive/gateway/commit/4e339333945f4c4547d9ae719e67b4671fe89f04), [`c9cd206`](https://github.com/graphql-hive/gateway/commit/c9cd20666a740514a5c17ecd6d0c000ad0dd7106), [`4e33933`](https://github.com/graphql-hive/gateway/commit/4e339333945f4c4547d9ae719e67b4671fe89f04), [`4e33933`](https://github.com/graphql-hive/gateway/commit/4e339333945f4c4547d9ae719e67b4671fe89f04), [`7b86c09`](https://github.com/graphql-hive/gateway/commit/7b86c097f5d424b82c84b87c743d5ed4ebe6aa5c), [`dbfb0f7`](https://github.com/graphql-hive/gateway/commit/dbfb0f7d6906d99b07b959bb6254d10e2fe2adf0)]: - @graphql-tools/delegate@10.2.16 - @graphql-tools/executor-http@1.3.2 - @graphql-tools/stitch@9.4.21 - @graphql-tools/wrap@10.0.34 ## 3.1.6 ### Patch Changes - [#862](https://github.com/graphql-hive/gateway/pull/862) [`278618a`](https://github.com/graphql-hive/gateway/commit/278618a1383a01016041ce0a40adec8803c62448) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates: - Updated dependency [`@whatwg-node/promise-helpers@^1.2.5` ↗︎](https://www.npmjs.com/package/@whatwg-node/promise-helpers/v/1.2.5) (from `^1.0.0`, in `dependencies`) - Updated dependencies [[`278618a`](https://github.com/graphql-hive/gateway/commit/278618a1383a01016041ce0a40adec8803c62448), [`278618a`](https://github.com/graphql-hive/gateway/commit/278618a1383a01016041ce0a40adec8803c62448), [`278618a`](https://github.com/graphql-hive/gateway/commit/278618a1383a01016041ce0a40adec8803c62448), [`278618a`](https://github.com/graphql-hive/gateway/commit/278618a1383a01016041ce0a40adec8803c62448)]: - @graphql-tools/delegate@10.2.15 - @graphql-tools/executor-http@1.3.1 - @graphql-tools/stitch@9.4.20 - @graphql-tools/wrap@10.0.33 ## 3.1.5 ### Patch Changes - [#726](https://github.com/graphql-hive/gateway/pull/726) [`6334b2e`](https://github.com/graphql-hive/gateway/commit/6334b2e5d4942693121ab7d44a96fa80408aace1) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates: - Added dependency [`@whatwg-node/promise-helpers@^1.0.0` ↗︎](https://www.npmjs.com/package/@whatwg-node/promise-helpers/v/1.0.0) (to `dependencies`) - [#727](https://github.com/graphql-hive/gateway/pull/727) [`c54a080`](https://github.com/graphql-hive/gateway/commit/c54a080b8b9c477ed55dd7c23fc8fcae9139bec8) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@whatwg-node/disposablestack@^0.0.6` ↗︎](https://www.npmjs.com/package/@whatwg-node/disposablestack/v/0.0.6) (from `^0.0.5`, in `dependencies`) - Updated dependencies [[`6334b2e`](https://github.com/graphql-hive/gateway/commit/6334b2e5d4942693121ab7d44a96fa80408aace1), [`6334b2e`](https://github.com/graphql-hive/gateway/commit/6334b2e5d4942693121ab7d44a96fa80408aace1), [`c54a080`](https://github.com/graphql-hive/gateway/commit/c54a080b8b9c477ed55dd7c23fc8fcae9139bec8), [`d949143`](https://github.com/graphql-hive/gateway/commit/d94914302b5b2c71b1c95df5145326fba89b023c), [`661b103`](https://github.com/graphql-hive/gateway/commit/661b103a7b9586641e69b78cbaad516e550e7192), [`6334b2e`](https://github.com/graphql-hive/gateway/commit/6334b2e5d4942693121ab7d44a96fa80408aace1), [`6334b2e`](https://github.com/graphql-hive/gateway/commit/6334b2e5d4942693121ab7d44a96fa80408aace1), [`9c2f323`](https://github.com/graphql-hive/gateway/commit/9c2f323ece47d9c0ef8f4e44050390096ceac17f), [`2a54e85`](https://github.com/graphql-hive/gateway/commit/2a54e85f2848aea7525703ea33918a21db96b26b)]: - @graphql-tools/delegate@10.2.14 - @graphql-tools/executor-http@1.3.0 - @graphql-tools/stitch@9.4.19 - @graphql-tools/wrap@10.0.32 ## 3.1.4 ### Patch Changes - [#696](https://github.com/graphql-hive/gateway/pull/696) [`a289faa`](https://github.com/graphql-hive/gateway/commit/a289faae1469eb46f1458be341d21909fe5f8f8f) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates: - Updated dependency [`@whatwg-node/fetch@^0.10.4` ↗︎](https://www.npmjs.com/package/@whatwg-node/fetch/v/0.10.4) (from `^0.10.1`, in `dependencies`) - Updated dependencies [[`a289faa`](https://github.com/graphql-hive/gateway/commit/a289faae1469eb46f1458be341d21909fe5f8f8f), [`20d275c`](https://github.com/graphql-hive/gateway/commit/20d275cd1badf76665874492d4550a7732b46f62)]: - @graphql-tools/executor-http@1.2.8 ## 3.1.3 ### Patch Changes - Updated dependencies [[`2318393`](https://github.com/graphql-hive/gateway/commit/2318393bc7b3aca7f53806a44b59277cd176702d)]: - @graphql-tools/delegate@10.2.13 - @graphql-tools/stitch@9.4.18 - @graphql-tools/wrap@10.0.31 ## 3.1.2 ### Patch Changes - [#620](https://github.com/graphql-hive/gateway/pull/620) [`d72209a`](https://github.com/graphql-hive/gateway/commit/d72209ad82ec53689f93ce5d81bfa52493919ad9) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@graphql-tools/utils@^10.8.1` ↗︎](https://www.npmjs.com/package/@graphql-tools/utils/v/10.8.1) (from `^10.7.0`, in `dependencies`) - Updated dependencies [[`d72209a`](https://github.com/graphql-hive/gateway/commit/d72209ad82ec53689f93ce5d81bfa52493919ad9), [`d72209a`](https://github.com/graphql-hive/gateway/commit/d72209ad82ec53689f93ce5d81bfa52493919ad9), [`d72209a`](https://github.com/graphql-hive/gateway/commit/d72209ad82ec53689f93ce5d81bfa52493919ad9), [`d72209a`](https://github.com/graphql-hive/gateway/commit/d72209ad82ec53689f93ce5d81bfa52493919ad9), [`7146f8d`](https://github.com/graphql-hive/gateway/commit/7146f8decca808ab2c68f4971ba9b64ca27a9b87), [`7146f8d`](https://github.com/graphql-hive/gateway/commit/7146f8decca808ab2c68f4971ba9b64ca27a9b87)]: - @graphql-tools/delegate@10.2.12 - @graphql-tools/executor-http@1.2.7 - @graphql-tools/stitch@9.4.17 - @graphql-tools/wrap@10.0.30 ## 3.1.1 ### Patch Changes - Updated dependencies [[`8c80ac9`](https://github.com/graphql-hive/gateway/commit/8c80ac98cd5afd7c063945f4704fe4866622c5d7), [`8c80ac9`](https://github.com/graphql-hive/gateway/commit/8c80ac98cd5afd7c063945f4704fe4866622c5d7)]: - @graphql-tools/executor-http@1.2.6 ## 3.1.0 ### Minor Changes - [#444](https://github.com/graphql-hive/gateway/pull/444) [`b52c9ba`](https://github.com/graphql-hive/gateway/commit/b52c9ba47f84d0905f1f63fdfe071c891dce5b7f) Thanks [@ardatan](https://github.com/ardatan)! - Now `SupergraphSchemaManager` can be used in `ApolloServer` as `gateway`; ```ts import { ApolloServer } from '@apollo/server'; import { SupergraphSchemaManager } from '@graphql-tools/federation'; const gateway = new SupergraphSchemaManager(); const apolloServer = new ApolloServer({ gateway, }); ``` And with the new `onStitchedSchema` option, you can manipulate the executable schema created from the supergraph. The following example demonstrates how to use `onStitchedSchema` with `applyMiddleware` from `graphql-middleware`: ```ts import { SupergraphSchemaManager } from '@graphql-tools/federation'; import { applyMiddleware } from 'graphql-middleware'; const logInput = async (resolve, root, args, context, info) => { console.log(`1. logInput: ${JSON.stringify(args)}`); const result = await resolve(root, args, context, info); console.log(`5. logInput`); return result; }; const logResult = async (resolve, root, args, context, info) => { console.log(`2. logResult`); const result = await resolve(root, args, context, info); console.log(`4. logResult: ${JSON.stringify(result)}`); return result; }; const gateway = new SupergraphSchemaManager({ onStitchedSchema: async (schema) => { // Manipulate the schema return applyMiddleware(schema, logInput, logResult); }, }); ``` ### Patch Changes - [#552](https://github.com/graphql-hive/gateway/pull/552) [`b0bc26b`](https://github.com/graphql-hive/gateway/commit/b0bc26b8e18a2e61e5fa96f48cd77820e3598b52) Thanks [@ardatan](https://github.com/ardatan)! - Handle shared subscription root fields correctly In case of conflicting subscription root fields coming from different subgraphs or different entry points(multiple keys), subscription was failing. - Updated dependencies [[`9144222`](https://github.com/graphql-hive/gateway/commit/91442220b2242a0fa082d4b544d03621572eecd0)]: - @graphql-tools/delegate@10.2.11 - @graphql-tools/stitch@9.4.16 - @graphql-tools/wrap@10.0.29 ## 3.0.10 ### Patch Changes - Updated dependencies [[`18682e6`](https://github.com/graphql-hive/gateway/commit/18682e6873091afe63f09414f02f93649a4da141), [`e9f78cd`](https://github.com/graphql-hive/gateway/commit/e9f78cd29681ca9b4371e12953a31d2b8f5e4c17)]: - @graphql-tools/delegate@10.2.10 - @graphql-tools/wrap@10.0.28 - @graphql-tools/stitch@9.4.15 ## 3.0.9 ### Patch Changes - [#443](https://github.com/graphql-hive/gateway/pull/443) [`a625269`](https://github.com/graphql-hive/gateway/commit/a62526936680d030339fc26cc55d76507134b022) Thanks [@ardatan](https://github.com/ardatan)! - In case of shared Mutation field in different subgraphs, choose the best option instead of choosing the last option just like we do in Query root fields - Updated dependencies [[`a625269`](https://github.com/graphql-hive/gateway/commit/a62526936680d030339fc26cc55d76507134b022), [`14152f7`](https://github.com/graphql-hive/gateway/commit/14152f70d91572c0e60ba15ddeb2ffd0b41c9e92)]: - @graphql-tools/stitch@9.4.14 - @graphql-tools/executor-http@1.2.5 ## 3.0.8 ### Patch Changes - [#351](https://github.com/graphql-hive/gateway/pull/351) [`0591aa9`](https://github.com/graphql-hive/gateway/commit/0591aa9cc9718a1c7d8b6fa68723a3155f775cc7) Thanks [@ardatan](https://github.com/ardatan)! - Keep the custom directives(using @composeDirective) from the supergraph, in the unified schema served by the gateway should keep it. ## 3.0.7 ### Patch Changes - [#387](https://github.com/graphql-hive/gateway/pull/387) [`3571399`](https://github.com/graphql-hive/gateway/commit/35713997b5330989b001c6317631621af24c404b) Thanks [@ardatan](https://github.com/ardatan)! - In case of shared root field on Mutation, it was batched incorrectly across subgraphs. But instead only one mutation should be called as mutations should not be parallel - Updated dependencies []: - @graphql-tools/executor-http@1.2.4 - @graphql-tools/stitch@9.4.13 ## 3.0.6 ### Patch Changes - Updated dependencies []: - @graphql-tools/stitch@9.4.12 ## 3.0.5 ### Patch Changes - Updated dependencies [[`55eb1b4`](https://github.com/graphql-hive/gateway/commit/55eb1b4d14aec7b3e6c7bcf9f596bc01192d022c), [`55eb1b4`](https://github.com/graphql-hive/gateway/commit/55eb1b4d14aec7b3e6c7bcf9f596bc01192d022c)]: - @graphql-tools/executor-http@1.2.3 ## 3.0.4 ### Patch Changes - [#373](https://github.com/graphql-hive/gateway/pull/373) [`e606975`](https://github.com/graphql-hive/gateway/commit/e60697593290255fb9ac407e591ae3e8cb752df2) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates: - Updated dependency [`@graphql-tools/utils@^10.7.0` ↗︎](https://www.npmjs.com/package/@graphql-tools/utils/v/10.7.0) (from `^10.6.2`, in `dependencies`) - Updated dependencies [[`e606975`](https://github.com/graphql-hive/gateway/commit/e60697593290255fb9ac407e591ae3e8cb752df2), [`e606975`](https://github.com/graphql-hive/gateway/commit/e60697593290255fb9ac407e591ae3e8cb752df2), [`e606975`](https://github.com/graphql-hive/gateway/commit/e60697593290255fb9ac407e591ae3e8cb752df2), [`e606975`](https://github.com/graphql-hive/gateway/commit/e60697593290255fb9ac407e591ae3e8cb752df2), [`15975c2`](https://github.com/graphql-hive/gateway/commit/15975c28daddbb4f31d520371f53520aecacaac7)]: - @graphql-tools/delegate@10.2.9 - @graphql-tools/executor-http@1.2.2 - @graphql-tools/stitch@9.4.11 - @graphql-tools/wrap@10.0.27 ## 3.0.3 ### Patch Changes - [#333](https://github.com/graphql-hive/gateway/pull/333) [`0d81307`](https://github.com/graphql-hive/gateway/commit/0d813079753e7c66158499e2db6e301a3c145856) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@graphql-yoga/typed-event-target@^3.0.1` ↗︎](https://www.npmjs.com/package/@graphql-yoga/typed-event-target/v/3.0.1) (from `^3.0.0`, in `dependencies`) ## 3.0.2 ### Patch Changes - Updated dependencies [[`23b8987`](https://github.com/graphql-hive/gateway/commit/23b89874fcf10b4cb6b1b941f29fa5f5aecf0ef2), [`23b8987`](https://github.com/graphql-hive/gateway/commit/23b89874fcf10b4cb6b1b941f29fa5f5aecf0ef2)]: - @graphql-tools/delegate@10.2.8 - @graphql-tools/executor-http@1.2.1 - @graphql-tools/stitch@9.4.10 - @graphql-tools/wrap@10.0.26 ## 3.0.1 ### Patch Changes - Updated dependencies [[`367b359`](https://github.com/graphql-hive/gateway/commit/367b3593cb7fd51c42ef4a13ab4adac202845734)]: - @graphql-tools/executor-http@1.2.0 ## 3.0.0 ### Major Changes - [#308](https://github.com/graphql-hive/gateway/pull/308) [`d747d4c`](https://github.com/graphql-hive/gateway/commit/d747d4cd37317e8a9b2b95a5270c0fbd47e4cba3) Thanks [@ardatan](https://github.com/ardatan)! - BREAKING CHANGES; - Removed `buildSubgraphSchema`, use `@apollo/subgraph` instead. - Removed the following gateway related functions, and prefer using Supergraph approach instead - `getSubschemaForFederationWithURL` - `getSubschemaForFederationWithTypeDefs` - `getSubschemaForFederationWithExecutor` - `getSubschemaForFederationWithSchema` - `federationSubschemaTransformer` - `SupergraphSchemaManager` is no longer an `EventEmitter` but `EventTarget` instead, and it emits a real `Event` object. - `SupergraphSchemaManager` is now `Disposable` and it no longer stops based on Nodejs terminate events, so you should use `using` syntax. ```ts using manager = new SupergraphSchemaManager({ ... }); manager.addEventListener('error', (event: SupergraphSchemaManagerErrorEvent) => { console.error(event.detail.error); }); let schema: GraphQLSchema | null = null; manager.addEventListener('schema', (event: SupergraphSchemaManagerSchemaEvent) => { schema = event.detail.schema; }); ``` ### Patch Changes - [#308](https://github.com/graphql-hive/gateway/pull/308) [`d747d4c`](https://github.com/graphql-hive/gateway/commit/d747d4cd37317e8a9b2b95a5270c0fbd47e4cba3) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates: - Added dependency [`@graphql-yoga/typed-event-target@^3.0.0` ↗︎](https://www.npmjs.com/package/@graphql-yoga/typed-event-target/v/3.0.0) (to `dependencies`) - Added dependency [`@whatwg-node/disposablestack@^0.0.5` ↗︎](https://www.npmjs.com/package/@whatwg-node/disposablestack/v/0.0.5) (to `dependencies`) - Added dependency [`@whatwg-node/events@^0.1.2` ↗︎](https://www.npmjs.com/package/@whatwg-node/events/v/0.1.2) (to `dependencies`) ## 2.2.40 ### Patch Changes - [#291](https://github.com/graphql-hive/gateway/pull/291) [`34d1224`](https://github.com/graphql-hive/gateway/commit/34d12249ead65b8277df976f6318dca757df1151) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates: - Updated dependency [`tslib@^2.8.1` ↗︎](https://www.npmjs.com/package/tslib/v/2.8.1) (from `^2.4.0`, in `dependencies`) - Updated dependencies [[`34d1224`](https://github.com/graphql-hive/gateway/commit/34d12249ead65b8277df976f6318dca757df1151), [`34d1224`](https://github.com/graphql-hive/gateway/commit/34d12249ead65b8277df976f6318dca757df1151), [`34d1224`](https://github.com/graphql-hive/gateway/commit/34d12249ead65b8277df976f6318dca757df1151), [`34d1224`](https://github.com/graphql-hive/gateway/commit/34d12249ead65b8277df976f6318dca757df1151)]: - @graphql-tools/delegate@10.2.7 - @graphql-tools/executor-http@1.1.14 - @graphql-tools/stitch@9.4.9 - @graphql-tools/wrap@10.0.25 ## 2.2.39 ### Patch Changes - Updated dependencies [[`3f1a0fa`](https://github.com/graphql-hive/gateway/commit/3f1a0fa9f1f3b91542d00a0211d7def8ef30827e)]: - @graphql-tools/executor-http@1.1.13 ## 2.2.38 ### Patch Changes - [#269](https://github.com/graphql-hive/gateway/pull/269) [`cdca511`](https://github.com/graphql-hive/gateway/commit/cdca5116ce30c2bfced1130c9fbead67280af9d4) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates: - Updated dependency [`@graphql-tools/merge@^9.0.12` ↗︎](https://www.npmjs.com/package/@graphql-tools/merge/v/9.0.12) (from `^9.0.9`, in `dependencies`) - Updated dependency [`@graphql-tools/schema@^10.0.11` ↗︎](https://www.npmjs.com/package/@graphql-tools/schema/v/10.0.11) (from `^10.0.8`, in `dependencies`) - Updated dependency [`@graphql-tools/utils@^10.6.2` ↗︎](https://www.npmjs.com/package/@graphql-tools/utils/v/10.6.2) (from `^10.6.0`, in `dependencies`) - Updated dependencies [[`7df2215`](https://github.com/graphql-hive/gateway/commit/7df2215abd309dc1dfd91f4ec91ce975f3982c62), [`cdca511`](https://github.com/graphql-hive/gateway/commit/cdca5116ce30c2bfced1130c9fbead67280af9d4), [`cdca511`](https://github.com/graphql-hive/gateway/commit/cdca5116ce30c2bfced1130c9fbead67280af9d4), [`cdca511`](https://github.com/graphql-hive/gateway/commit/cdca5116ce30c2bfced1130c9fbead67280af9d4), [`cdca511`](https://github.com/graphql-hive/gateway/commit/cdca5116ce30c2bfced1130c9fbead67280af9d4)]: - @graphql-tools/delegate@10.2.6 - @graphql-tools/executor-http@1.1.12 - @graphql-tools/stitch@9.4.8 - @graphql-tools/wrap@10.0.24 ## 2.2.37 ### Patch Changes - Updated dependencies [[`9ce705c`](https://github.com/graphql-hive/gateway/commit/9ce705c5ccc5e6f4ac26af6e6471a6d2f4e995db)]: - @graphql-tools/delegate@10.2.5 - @graphql-tools/stitch@9.4.7 - @graphql-tools/wrap@10.0.23 ## 2.2.36 ### Patch Changes - Updated dependencies [[`76642d8`](https://github.com/graphql-hive/gateway/commit/76642d84b722bae28115310f25a6ac4865b41598)]: - @graphql-tools/stitch@9.4.6 ## 2.2.35 ### Patch Changes - Updated dependencies []: - @graphql-tools/delegate@10.2.4 - @graphql-tools/stitch@9.4.5 - @graphql-tools/wrap@10.0.22 ## 2.2.34 ### Patch Changes - [#234](https://github.com/graphql-hive/gateway/pull/234) [`ba7e585`](https://github.com/graphql-hive/gateway/commit/ba7e585bcabbcec2ccd35f0903f25fdce9eeb214) Thanks [@ardatan](https://github.com/ardatan)! - Drop \`@hidden\` support in favor of \`@inaccessible\` ## 2.2.33 ### Patch Changes - [#231](https://github.com/graphql-hive/gateway/pull/231) [`7ca0ff3`](https://github.com/graphql-hive/gateway/commit/7ca0ff331e42c133c4218a8086bbf0a7607f45d0) Thanks [@ardatan](https://github.com/ardatan)! - Avoid extensions and use \`stitchingInfo\` for provided fields - Updated dependencies [[`7ca0ff3`](https://github.com/graphql-hive/gateway/commit/7ca0ff331e42c133c4218a8086bbf0a7607f45d0)]: - @graphql-tools/delegate@10.2.3 - @graphql-tools/stitch@9.4.4 - @graphql-tools/wrap@10.0.21 ## 2.2.32 ### Patch Changes - [#205](https://github.com/graphql-hive/gateway/pull/205) [`2e0add3`](https://github.com/graphql-hive/gateway/commit/2e0add3ea9b237ad385d5b5cd4c12eeeb847805a) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates: - Updated dependency [`@whatwg-node/fetch@^0.10.1` ↗︎](https://www.npmjs.com/package/@whatwg-node/fetch/v/0.10.1) (from `^0.10.0`, in `dependencies`) - [#205](https://github.com/graphql-hive/gateway/pull/205) [`2e0add3`](https://github.com/graphql-hive/gateway/commit/2e0add3ea9b237ad385d5b5cd4c12eeeb847805a) Thanks [@ardatan](https://github.com/ardatan)! - Fix missing key fields in the nested queries - Updated dependencies [[`2e0add3`](https://github.com/graphql-hive/gateway/commit/2e0add3ea9b237ad385d5b5cd4c12eeeb847805a), [`2e0add3`](https://github.com/graphql-hive/gateway/commit/2e0add3ea9b237ad385d5b5cd4c12eeeb847805a)]: - @graphql-tools/executor-http@1.1.11 - @graphql-tools/delegate@10.2.2 - @graphql-tools/stitch@9.4.3 - @graphql-tools/wrap@10.0.20 ## 2.2.31 ### Patch Changes - [#164](https://github.com/graphql-hive/gateway/pull/164) [`310613d`](https://github.com/graphql-hive/gateway/commit/310613d68d1df3e2bceafbd0730084a4c83527bf) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates: - Updated dependency [`@graphql-tools/utils@^10.6.0` ↗︎](https://www.npmjs.com/package/@graphql-tools/utils/v/10.6.0) (from `^10.5.6`, in `dependencies`) - [#185](https://github.com/graphql-hive/gateway/pull/185) [`f0b6921`](https://github.com/graphql-hive/gateway/commit/f0b69219fefc1b24c5511a1c623a5e3bbaf5ca0b) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates: - Removed dependency [`value-or-promise@^1.0.12` ↗︎](https://www.npmjs.com/package/value-or-promise/v/1.0.12) (from `dependencies`) - [#188](https://github.com/graphql-hive/gateway/pull/188) [`f71366d`](https://github.com/graphql-hive/gateway/commit/f71366d234fe8f30a419814fe1460f1e22663241) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates: - Removed dependency [`value-or-promise@^1.0.12` ↗︎](https://www.npmjs.com/package/value-or-promise/v/1.0.12) (from `dependencies`) - [#199](https://github.com/graphql-hive/gateway/pull/199) [`b534288`](https://github.com/graphql-hive/gateway/commit/b5342885f8ac1197d70cbf45266c83b720b4f85a) Thanks [@ardatan](https://github.com/ardatan)! - Logs are now easier to read, bigger results not do not create bigger outputs but instead they are all logged in a single line - Updated dependencies [[`310613d`](https://github.com/graphql-hive/gateway/commit/310613d68d1df3e2bceafbd0730084a4c83527bf), [`310613d`](https://github.com/graphql-hive/gateway/commit/310613d68d1df3e2bceafbd0730084a4c83527bf), [`9438e21`](https://github.com/graphql-hive/gateway/commit/9438e21982ed5c6fb18cb678b275046595ae00f5), [`310613d`](https://github.com/graphql-hive/gateway/commit/310613d68d1df3e2bceafbd0730084a4c83527bf), [`f0b6921`](https://github.com/graphql-hive/gateway/commit/f0b69219fefc1b24c5511a1c623a5e3bbaf5ca0b), [`f71366d`](https://github.com/graphql-hive/gateway/commit/f71366d234fe8f30a419814fe1460f1e22663241), [`310613d`](https://github.com/graphql-hive/gateway/commit/310613d68d1df3e2bceafbd0730084a4c83527bf), [`f0b6921`](https://github.com/graphql-hive/gateway/commit/f0b69219fefc1b24c5511a1c623a5e3bbaf5ca0b), [`f71366d`](https://github.com/graphql-hive/gateway/commit/f71366d234fe8f30a419814fe1460f1e22663241), [`9438e21`](https://github.com/graphql-hive/gateway/commit/9438e21982ed5c6fb18cb678b275046595ae00f5), [`b534288`](https://github.com/graphql-hive/gateway/commit/b5342885f8ac1197d70cbf45266c83b720b4f85a), [`697308d`](https://github.com/graphql-hive/gateway/commit/697308df3b2dd96f28dc65a5f5361a911077e022)]: - @graphql-tools/delegate@10.2.1 - @graphql-tools/executor-http@1.1.10 - @graphql-tools/stitch@9.4.2 - @graphql-tools/wrap@10.0.19 ## 2.2.30 ### Patch Changes - [`725d5b7`](https://github.com/graphql-hive/gateway/commit/725d5b7952be3a2fb2caeb40d26c194fb03b35d5) Thanks [@ardatan](https://github.com/ardatan)! - Fix regression on override type interface - Updated dependencies [[`725d5b7`](https://github.com/graphql-hive/gateway/commit/725d5b7952be3a2fb2caeb40d26c194fb03b35d5)]: - @graphql-tools/stitch@9.4.1 ## 2.2.29 ### Patch Changes - Updated dependencies [[`f32cb2a`](https://github.com/graphql-hive/gateway/commit/f32cb2a0289aa32e4811ced5dc1aac3efb0674f1)]: - @graphql-tools/delegate@10.2.0 - @graphql-tools/stitch@9.4.0 - @graphql-tools/wrap@10.0.18 ## 2.2.28 ### Patch Changes - Updated dependencies [[`73c621d`](https://github.com/graphql-hive/gateway/commit/73c621d98a4e6ca134527e349bc71223c03d06db), [`19bc6a4`](https://github.com/graphql-hive/gateway/commit/19bc6a4c222ff157553785ea16760888cdfe10bb)]: - @graphql-tools/delegate@10.1.3 - @graphql-tools/wrap@10.0.17 - @graphql-tools/stitch@9.3.5 ## 2.2.26 ### Patch Changes - [#6663](https://github.com/ardatan/graphql-tools/pull/6663) [`d06afe3`](https://github.com/ardatan/graphql-tools/commit/d06afe3065edb15f4c58c1c155a230d8d542669f) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - Updated dependency [`@whatwg-node/fetch@^0.10.0` ↗︎](https://www.npmjs.com/package/@whatwg-node/fetch/v/0.10.0) (from `^0.9.17`, in `dependencies`) - Updated dependencies [[`d06afe3`](https://github.com/ardatan/graphql-tools/commit/d06afe3065edb15f4c58c1c155a230d8d542669f), [`04d5cd7`](https://github.com/ardatan/graphql-tools/commit/04d5cd785be759f0327586a75b9a6ef70cbacf95)]: - @graphql-tools/executor-http@1.1.8 ## 2.2.25 ### Patch Changes - [`342e044`](https://github.com/ardatan/graphql-tools/commit/342e044c7da74aaf5df6a90ce68973c525c9aa10) Thanks [@ardatan](https://github.com/ardatan)! - Prevent extra queries to the same subgraph multiple times on the same plan, and merge iterables correctly - Updated dependencies [[`342e044`](https://github.com/ardatan/graphql-tools/commit/342e044c7da74aaf5df6a90ce68973c525c9aa10)]: - @graphql-tools/delegate@10.1.1 - @graphql-tools/stitch@9.3.3 - @graphql-tools/wrap@10.0.15 ## 2.2.24 ### Patch Changes - [#6619](https://github.com/ardatan/graphql-tools/pull/6619) [`e9906eb`](https://github.com/ardatan/graphql-tools/commit/e9906eb311132ab902720e75bc787228d67c0e34) Thanks [@kroupacz](https://github.com/kroupacz)! - Handle shared root field queries with aliases - Updated dependencies [[`e9906eb`](https://github.com/ardatan/graphql-tools/commit/e9906eb311132ab902720e75bc787228d67c0e34)]: - @graphql-tools/delegate@10.1.0 - @graphql-tools/stitch@9.3.2 - @graphql-tools/wrap@10.0.14 ## 2.2.23 ### Patch Changes - Updated dependencies [[`da1de08`](https://github.com/ardatan/graphql-tools/commit/da1de08c269a4cb3ed8240bf191833f7e75a6b01)]: - @graphql-tools/delegate@10.0.29 - @graphql-tools/stitch@9.3.1 - @graphql-tools/wrap@10.0.13 ## 2.2.22 ### Patch Changes - Updated dependencies [[`2bb2adb`](https://github.com/ardatan/graphql-tools/commit/2bb2adbe81ab940e582ea2c779a766817c099c9c)]: - @graphql-tools/stitch@9.3.0 ## 2.2.21 ### Patch Changes - [`5145fc4`](https://github.com/ardatan/graphql-tools/commit/5145fc4f4eed543219dbab5c0bd54e4636e1b952) Thanks [@ardatan](https://github.com/ardatan)! - Run \`onSubschemaConfig\` in the right place ## 2.2.20 ### Patch Changes - Updated dependencies [[`f470f49`](https://github.com/ardatan/graphql-tools/commit/f470f49f7d8445801a2983f14532124588f9f59e)]: - @graphql-tools/delegate@10.0.28 - @graphql-tools/stitch@9.2.17 - @graphql-tools/wrap@10.0.12 ## 2.2.19 ### Patch Changes - [`180f3f0`](https://github.com/ardatan/graphql-tools/commit/180f3f0c8362613eb3013ff12f2d5405cd987903) Thanks [@ardatan](https://github.com/ardatan)! - Avoid extra calls if the keys are already resolved - Updated dependencies [[`180f3f0`](https://github.com/ardatan/graphql-tools/commit/180f3f0c8362613eb3013ff12f2d5405cd987903)]: - @graphql-tools/delegate@10.0.27 - @graphql-tools/stitch@9.2.16 - @graphql-tools/wrap@10.0.11 ## 2.2.18 ### Patch Changes - [#6598](https://github.com/ardatan/graphql-tools/pull/6598) [`4deac7f`](https://github.com/ardatan/graphql-tools/commit/4deac7f3ac468334874f1d9e4ab41943fdf2818c) Thanks [@kroupacz](https://github.com/kroupacz)! - If `currentUnavailableSelectionSet.selections` is empty array then "query planning" will fail. ## 2.2.17 ### Patch Changes - [`b1e002f`](https://github.com/ardatan/graphql-tools/commit/b1e002f16fe01f7d5d42f9a6b6c8d3ec67fe93ba) Thanks [@ardatan](https://github.com/ardatan)! - If required non-nullable key is null, do not send it to the subgraph; See optimizations.test.ts for more details. ## 2.2.16 ### Patch Changes - [#6586](https://github.com/ardatan/graphql-tools/pull/6586) [`8effad4`](https://github.com/ardatan/graphql-tools/commit/8effad4ffb9be1bca098b8cb6ce41b84ac7d9b6b) Thanks [@ardatan](https://github.com/ardatan)! - Performance improvements on upstream request execution - Updated dependencies [[`8effad4`](https://github.com/ardatan/graphql-tools/commit/8effad4ffb9be1bca098b8cb6ce41b84ac7d9b6b)]: - @graphql-tools/delegate@10.0.26 - @graphql-tools/stitch@9.2.15 - @graphql-tools/wrap@10.0.10 ## 2.2.15 ### Patch Changes - Updated dependencies [[`8a16b01`](https://github.com/ardatan/graphql-tools/commit/8a16b01296457bdcfbb111e02b6f6569ef8b04aa)]: - @graphql-tools/delegate@10.0.25 - @graphql-tools/stitch@9.2.14 - @graphql-tools/wrap@10.0.9 ## 2.2.14 ### Patch Changes - [`e0070c2`](https://github.com/ardatan/graphql-tools/commit/e0070c2327ca49bc2a87b88d6ff1066ac2078d2b) Thanks [@ardatan](https://github.com/ardatan)! - Fix unavailable field error throwing ## 2.2.13 ### Patch Changes - Updated dependencies [[`4cdb462`](https://github.com/ardatan/graphql-tools/commit/4cdb46248774f2d5ae2757d40e1d55e83d7413b3)]: - @graphql-tools/delegate@10.0.24 - @graphql-tools/stitch@9.2.13 - @graphql-tools/wrap@10.0.8 ## 2.2.12 ### Patch Changes - [#6573](https://github.com/ardatan/graphql-tools/pull/6573) [`7e2938d`](https://github.com/ardatan/graphql-tools/commit/7e2938d45c6d0a6eb6b18b89f9f80e9b5b5c08db) Thanks [@ardatan](https://github.com/ardatan)! - When there are two services like below then the following query senty, the gateway tries to fetch `id` as an extra field because it considers `id` might be needed while this is not correct. This patch avoids any extra calls, and forwards the query as is to the 2nd service. ```graphql query { viewer { booksContainer(input: $input) { edges { cursor node { source { # Book(upc=) upc } } } pageInfo { endCursor } } } } ``` ```graphql type Book @key(fields: "id") @key(fields: "upc") { id: ID! upc: ID! } ``` ```graphql type BookContainer { # the type that is used in a collection id: ID! # ... other stuff here source: Book! } type Book @key(fields: "upc") { upc: ID! } type Query { viewer: Viewer } type Viewer { booksContainer: BooksContainerResult } type BooksContainerResult { edges: [BooksContainerEdge!]! pageInfo: PageInfo! } type BooksContainerEdge { node: BookContainer! cursor: String! } type PageInfo { endCursor: String } ``` - Updated dependencies [[`7e2938d`](https://github.com/ardatan/graphql-tools/commit/7e2938d45c6d0a6eb6b18b89f9f80e9b5b5c08db)]: - @graphql-tools/delegate@10.0.23 - @graphql-tools/stitch@9.2.12 - @graphql-tools/wrap@10.0.7 ## 2.2.11 ### Patch Changes - Updated dependencies [[`dcb3e27`](https://github.com/ardatan/graphql-tools/commit/dcb3e276cce59340596156542bcede9d8b143d44), [`cf2ce5e`](https://github.com/ardatan/graphql-tools/commit/cf2ce5ed4773087cc324599f2812f4fb91398b21)]: - @graphql-tools/stitch@9.2.11 - @graphql-tools/utils@10.5.5 - @graphql-tools/delegate@10.0.22 - @graphql-tools/executor-http@1.1.7 - @graphql-tools/merge@9.0.8 - @graphql-tools/schema@10.0.7 - @graphql-tools/wrap@10.0.6 ## 2.2.10 ### Patch Changes - [`a600be6`](https://github.com/ardatan/graphql-tools/commit/a600be627a6d619ef4c95a445a5c7801d166787b) Thanks [@ardatan](https://github.com/ardatan)! - Add `onSubgraphAST` ## 2.2.9 ### Patch Changes - [#6469](https://github.com/ardatan/graphql-tools/pull/6469) [`0e87805`](https://github.com/ardatan/graphql-tools/commit/0e8780572fb1a852c8f4d7c8a59b064ae92bdd6b) Thanks [@User!](https://github.com/User!)! - Handle merged selection sets in the computed fields; When a selection set for a computed field needs to be merged, resolve that required selection set fully then resolve the computed field. In the following case, the selection set for the `author` field in the `Post` type is merged with the selection set for the `authorId` field in the `Comment` type. ```graphql type Query { feed: [Post!]! } type Post { id: ID! @computed(selectionSet: "{ comments { authorId } }") } type Comment { id: ID! authorId: ID! } type User { id: ID! name: String! } ``` ```graphql type Post { id: ID! comments: [Comment!]! } type Comment { id: ID! } ``` - Updated dependencies [[`0e87805`](https://github.com/ardatan/graphql-tools/commit/0e8780572fb1a852c8f4d7c8a59b064ae92bdd6b)]: - @graphql-tools/delegate@10.0.20 ## 2.2.8 ### Patch Changes - [#6441](https://github.com/ardatan/graphql-tools/pull/6441) [`52a69ed`](https://github.com/ardatan/graphql-tools/commit/52a69edb8979fd081d1caea90684f5d61dc9f6ec) Thanks [@ardatan](https://github.com/ardatan)! - Filter errors as null in the projected key If the key field has `Error`, do not send them to the subgraphs as objects but `null`. ## 2.2.7 ### Patch Changes - [#6437](https://github.com/ardatan/graphql-tools/pull/6437) [`3188051`](https://github.com/ardatan/graphql-tools/commit/3188051ae530772210e9f3a2c9615932ef13f497) Thanks [@User](https://github.com/User), [@()](<https://github.com/()>), [@{](https://github.com/{), [@{](https://github.com/{), [@{](https://github.com/{), [@{](https://github.com/{), [@{](https://github.com/{)! - Fix the bug happens when a merged field is a computed field requires another computed field requires a field from the initial subschema. In the following test case, `totalOrdersPrices` needs `userOrders` which needs `lastName` from initial `Query.user`. So the bug was skipping the dependencies of `userOrders` because it assumed `lastName` already there by mistake. ```ts const schema1 = makeExecutableSchema({ typeDefs: /* GraphQL */ ` type User { id: ID! firstName: String! lastName: String! address: String } type Query { } `, resolvers: { Query: { => { return { id: 1, firstName: 'Jake', lastName: 'Dawkins', address: 'everywhere', }; }, }, }, }); const schema2 = makeExecutableSchema({ typeDefs: /* GraphQL */ ` type UserOrder { id: ID! } type User { id: ID! totalOrdersPrices: Int aggregatedOrdersByStatus: Int } type Query { userWithOrderDetails(userId: ID!, userOrderIds: [ID]): User } `, resolvers: { Query: { userWithOrderDetails: (_root, { userId, userOrderIds }) => { return { id: userId, userOrders: userOrderIds?.map((userOrderId: string) => ({ id: userOrderId })), }; }, }, totalOrdersPrices(user) { if (user.userOrders instanceof Error) { return user.userOrders; } if (!user.userOrders) { throw new Error('UserOrders is required'); } return 0; }, aggregatedOrdersByStatus(user) { if (user.userOrders instanceof Error) { return user.userOrders; } if (!user.userOrders) { throw new Error('UserOrders is required'); } return 1; }, }, }, }); const schema3 = makeExecutableSchema({ typeDefs: /* GraphQL */ ` type User { id: ID! userOrders: [UserOrder!] } type UserOrder { id: ID! } type Query { userWithOrders(id: ID!, lastName: String): User } `, resolvers: { Query: { userWithOrders: (_root, { id, lastName }) => { return { id, lastName, }; }, }, userOrders(user) { if (!user.lastName) { throw new Error('LastName is required'); } return [ { id: `${user.lastName}1`, }, ]; }, }, }, }); const stitchedSchema = stitchSchemas({ subschemas: [ { schema: schema1, }, { schema: schema2, merge: { selectionSet: '{ id }', fieldName: 'userWithOrderDetails', args: ({ id, userOrders }: { id: string; userOrders: any[] }) => ({ userId: id, userOrderIds: userOrders?.map?.(({ id }: { id: string }) => id), }), fields: { totalOrdersPrices: { selectionSet: '{ userOrders { id } }', computed: true, }, aggregatedOrdersByStatus: { selectionSet: '{ userOrders { id } }', computed: true, }, }, }, }, }, { schema: schema3, merge: { selectionSet: '{ id }', fieldName: 'userWithOrders', args: ({ id, lastName }: { id: string; lastName: string }) => ({ id, lastName, }), fields: { userOrders: { selectionSet: '{ lastName }', computed: true, }, }, }, }, }, ], }); const res = await normalizedExecutor({ schema: stitchedSchema, document: parse(/* GraphQL */ ` query User { user { aggregatedOrdersByStatus totalOrdersPrices } } `), }); expect(res).toEqual({ data: { aggregatedOrdersByStatus: 1, totalOrdersPrices: 0, }, }, }); ``` - Updated dependencies [[`3188051`](https://github.com/ardatan/graphql-tools/commit/3188051ae530772210e9f3a2c9615932ef13f497)]: - @graphql-tools/delegate@10.0.19 ## 2.2.6 ### Patch Changes - [`b8bf584`](https://github.com/ardatan/graphql-tools/commit/b8bf584fde87d3064c204d8ac2f9da5b869249c0) Thanks [@ardatan](https://github.com/ardatan)! - Introduce \`getDirectiveExtensions\` and refactor directive handling in the extensions - Updated dependencies [[`b8bf584`](https://github.com/ardatan/graphql-tools/commit/b8bf584fde87d3064c204d8ac2f9da5b869249c0)]: - @graphql-tools/utils@10.4.0 - @graphql-tools/schema@10.0.5 - @graphql-tools/merge@9.0.5 ## 2.2.5 ### Patch Changes - [`dbb0516`](https://github.com/ardatan/graphql-tools/commit/dbb05162731b7a2baf08f4756d4a4de3dce0a951) Thanks [@ardatan](https://github.com/ardatan)! - If there are repeated computed fields like below, project the data for the computed fields for each `fields` and merge them correctly. And if they are array as in `userOrders`, merge them by respecting the order (the second one can have `price` maybe). ```graphql type UserOrder @key(fields: "id") { id: ID! status: String! price: Int! } type User @key(fields: "id") { id: ID! userOrders: [UserOrder!] @external totalOrdersPrices: Int @requires(fields: "userOrders { id }") aggregatedOrdersByStatus: Int @requires(fields: "userOrders { id }") } ``` ## 2.2.4 ### Patch Changes - [#6403](https://github.com/ardatan/graphql-tools/pull/6403) [`3803897`](https://github.com/ardatan/graphql-tools/commit/3803897cef27b15bad1718819c5d75030afbe781) Thanks [@ardatan](https://github.com/ardatan)! - Cleanup extra fields, empty inline fragments and duplicate \_\_typename fields - Updated dependencies [[`3803897`](https://github.com/ardatan/graphql-tools/commit/3803897cef27b15bad1718819c5d75030afbe781)]: - @graphql-tools/delegate@10.0.17 ## 2.2.3 ### Patch Changes - [`0d203ab`](https://github.com/ardatan/graphql-tools/commit/0d203ab57671cfa6d4417e60b08b3224a65bec91) Thanks [@ardatan](https://github.com/ardatan)! - Support `@requires` with arguments like `@requires(fields: "price(currency: 'USD')")` ## 2.2.2 ### Patch Changes - [`63cab60`](https://github.com/ardatan/graphql-tools/commit/63cab60dca3f36614ff5cb26869e1e7d3e939c50) Thanks [@ardatan](https://github.com/ardatan)! - Use type definition merger instead of \`concatAST\` to merge type definitions for creating a subschema for Federation ## 2.2.1 ### Patch Changes - [`33e8146`](https://github.com/ardatan/graphql-tools/commit/33e8146e33aa17790ee76d14e52f62c684ee1b16) Thanks [@ardatan](https://github.com/ardatan)! - Fail on query planning phase if the query plan is not successful before the actual execution - Updated dependencies [[`33e8146`](https://github.com/ardatan/graphql-tools/commit/33e8146e33aa17790ee76d14e52f62c684ee1b16)]: - @graphql-tools/delegate@10.0.16 ## 2.2.0 ### Minor Changes - [#6368](https://github.com/ardatan/graphql-tools/pull/6368) [`334d301`](https://github.com/ardatan/graphql-tools/commit/334d301007d4d73e09182f22a76bdce1937ec8af) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - Expose the loaded supergrapth SDL in the `schema` event ## 2.1.4 ### Patch Changes - [`167b47c`](https://github.com/ardatan/graphql-tools/commit/167b47cbc6ae31ce046cf6cc17365813d2481d4c) Thanks [@ardatan](https://github.com/ardatan)! - New options to configure query batching and batched delegation ```ts { batchingOptions: { dataLoaderOptions: { maxBatchSize: 10, // Limits the query batching } }, batchDelegateOptions: { maxBatchSize: 10, // Limits the batch delegation } } ``` Learn more about these here; [Batch Delegation](https://the-guild.dev/graphql/stitching/docs/approaches/schema-extensions#batch-delegation-array-batching) [Query Batching](https://the-guild.dev/graphql/stitching/docs/getting-started/remote-subschemas#batch-the-executor-query-batching) ## 2.1.3 ### Patch Changes - [`d54b21a`](https://github.com/ardatan/graphql-tools/commit/d54b21a235f9632d320a32f15594ecd70b5eae29) Thanks [@ardatan](https://github.com/ardatan)! - Do not apply type merging for non-resolvable entities - Updated dependencies [[`d54b21a`](https://github.com/ardatan/graphql-tools/commit/d54b21a235f9632d320a32f15594ecd70b5eae29), [`d54b21a`](https://github.com/ardatan/graphql-tools/commit/d54b21a235f9632d320a32f15594ecd70b5eae29)]: - @graphql-tools/delegate@10.0.15 ## 2.1.2 ### Patch Changes - [#6355](https://github.com/ardatan/graphql-tools/pull/6355) [`c6d175b`](https://github.com/ardatan/graphql-tools/commit/c6d175b2c1de640d2156ba0b2c69bf7e8884d98f) Thanks [@ardatan](https://github.com/ardatan)! - Handle errors coming from subgraphs correctly when a root field is shared by different subgraphs - If subgraph A returns an error for `Query.foo`, and subgraph B returns the data, ignore the error and keep it for null fields. - If both subgraphs return errors, return them as `AggregateError` then return them to the gateway result. - Updated dependencies [[`8094c37`](https://github.com/ardatan/graphql-tools/commit/8094c3733c745b2ccb7adcca38024c82c42319a0), [`97c88a0`](https://github.com/ardatan/graphql-tools/commit/97c88a0844eff2ace5914b8e18a2d32dc5b8c265)]: - @graphql-tools/delegate@10.0.14 - @graphql-tools/executor-http@1.1.5 ## 2.1.1 ### Patch Changes - [#6293](https://github.com/ardatan/graphql-tools/pull/6293) [`3f301dc`](https://github.com/ardatan/graphql-tools/commit/3f301dc74a99ea1db28fe75923fa26ba2736d9f7) Thanks [@ardatan](https://github.com/ardatan)! - Do not use `entryPoints` for `MergedTypeConfig` if there is only one - [#6278](https://github.com/ardatan/graphql-tools/pull/6278) [`66c99d9`](https://github.com/ardatan/graphql-tools/commit/66c99d9c9e480cc4e1569b032952caea0ff69c0c) Thanks [@ardatan](https://github.com/ardatan)! - Exclude `@defer` in the subgraph requests - Updated dependencies [[`66c99d9`](https://github.com/ardatan/graphql-tools/commit/66c99d9c9e480cc4e1569b032952caea0ff69c0c), [`3f301dc`](https://github.com/ardatan/graphql-tools/commit/3f301dc74a99ea1db28fe75923fa26ba2736d9f7)]: - @graphql-tools/delegate@10.0.12 - @graphql-tools/stitch@9.2.10 - @graphql-tools/utils@10.2.3 ## 2.1.0 ### Minor Changes - [#6267](https://github.com/ardatan/graphql-tools/pull/6267) [`d5dd794`](https://github.com/ardatan/graphql-tools/commit/d5dd794352878aec9b0d543dfe2e6995142dddff) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - Add `delayInSeconds` to the `failure` event to give users more control on failure handling. - [#6267](https://github.com/ardatan/graphql-tools/pull/6267) [`d5dd794`](https://github.com/ardatan/graphql-tools/commit/d5dd794352878aec9b0d543dfe2e6995142dddff) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - Add a the ability to start polling with a delay. This ease the handling of failure handling, allowing to restart the manager and respecting GraphOS minimum retry delay. ### Patch Changes - [#6267](https://github.com/ardatan/graphql-tools/pull/6267) [`d5dd794`](https://github.com/ardatan/graphql-tools/commit/d5dd794352878aec9b0d543dfe2e6995142dddff) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - Fix Supergraph Manager Event Emitter not calling every listener when at least one has been registered using `once` method. ## 2.0.1 ### Patch Changes - [#6238](https://github.com/ardatan/graphql-tools/pull/6238) [`0f7059b`](https://github.com/ardatan/graphql-tools/commit/0f7059beb218d0012c48e121c55e7db386796bee) Thanks [@ardatan](https://github.com/ardatan)! - Merge the elements of the lists if the root field is shared across different subgraphs ```graphql type Query { products: [Product] # If this field is returned by multiple subgraphs, the elements of the lists will be merged } ``` - Updated dependencies [[`0f7059b`](https://github.com/ardatan/graphql-tools/commit/0f7059beb218d0012c48e121c55e7db386796bee)]: - @graphql-tools/utils@10.2.2 ## 2.0.0 ### Major Changes - [#6227](https://github.com/ardatan/graphql-tools/pull/6227) [`85c383f`](https://github.com/ardatan/graphql-tools/commit/85c383fbb44eeb2a0509480d84ca0b12811bc3ca) Thanks [@ardatan](https://github.com/ardatan)! - BREAKING CHANGES: - `getSubschemasFromSupergraphSdl` has been removed in favor of the new `getStitchingOptionsFromSupergraphSdl`, and it returns the options for `stitchSchemas` instead of the map of subschemas - `onExecutor` has been removed in favor of `onSubschemaConfig` - To change the default HTTP executor options, use `httpExecutorOpts` instead of `onExecutor` ### Patch Changes - [#6223](https://github.com/ardatan/graphql-tools/pull/6223) [`db29280`](https://github.com/ardatan/graphql-tools/commit/db29280ef4b058857923ed8a207052fe06ba5fa0) Thanks [@EmrysMyrddin](https://github.com/EmrysMyrddin)! - dependencies updates: - Added dependency [`@whatwg-node/fetch@^0.9.17` ↗︎](https://www.npmjs.com/package/@whatwg-node/fetch/v/0.9.17) (to `dependencies`) ## 1.1.36 ### Patch Changes - [#6194](https://github.com/ardatan/graphql-tools/pull/6194) [`7368829`](https://github.com/ardatan/graphql-tools/commit/73688291af0c8cb2fe550fe8c74fd8af84cb360f) Thanks [@ardatan](https://github.com/ardatan)! - Handle interface objects in a different way - [#6189](https://github.com/ardatan/graphql-tools/pull/6189) [`0134f7f`](https://github.com/ardatan/graphql-tools/commit/0134f7ffe5383603961d69337bfa5bceefb3ed74) Thanks [@ardatan](https://github.com/ardatan)! - Handle interface types with non-shared implementations; For example, you have the following services, where `Node` is implemented in both services, but `Foo` and `Bar` are only implemented in one service. And when the gateway receives the following query, it should be converted to this because `Node` is not implemented as `Bar` in Service 1 while implemented in Service 2. Query conversion; ```graphql # Gateway request query { fooBar(id: "1") { ... on Node { id } } } ``` ```graphql # Service 1 Request query { fooBar(id: "1") { ... on Foo { id } ... on Bar { id } } } ``` Services; ```graphql # Service 1 union FooBar = Foo | Bar interface Node { id: ID! } type Foo implements Node { id: ID! } type Bar { id: ID! } type Query { fooBar(id: ID!): FooBar } ``` ```graphql # Service 2 interface Node { id: ID! } type Foo implements Node { id: ID! } type Bar implements Node { id: ID! } ``` - [#6187](https://github.com/ardatan/graphql-tools/pull/6187) [`dfccfbf`](https://github.com/ardatan/graphql-tools/commit/dfccfbfd6633dd576f660c648f3c6cecff3667a1) Thanks [@ardatan](https://github.com/ardatan)! - Respect @provides to optimize the query plan - [#6188](https://github.com/ardatan/graphql-tools/pull/6188) [`e10c13a`](https://github.com/ardatan/graphql-tools/commit/e10c13a60e344b9217dc77a7cac50ec447feda7e) Thanks [@arda