diff --git a/.changeset/@graphql-tools_delegate-5477-dependencies.md b/.changeset/@graphql-tools_delegate-5477-dependencies.md deleted file mode 100644 index b32e6f338bb..00000000000 --- a/.changeset/@graphql-tools_delegate-5477-dependencies.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@graphql-tools/delegate": patch ---- -dependencies updates: - - Removed dependency [`value-or-promise@^1.0.12` ↗︎](https://www.npmjs.com/package/value-or-promise/v/1.0.12) (from `dependencies`) diff --git a/.changeset/lemon-llamas-brake.md b/.changeset/lemon-llamas-brake.md deleted file mode 100644 index 0d30572876d..00000000000 --- a/.changeset/lemon-llamas-brake.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@graphql-tools/batch-execute': patch -'@graphql-tools/delegate': patch -'@graphql-tools/utils': patch ---- - -Optimizations to get better performance in query planning diff --git a/packages/batch-execute/CHANGELOG.md b/packages/batch-execute/CHANGELOG.md index f3df679e7e8..1d67e8040b1 100644 --- a/packages/batch-execute/CHANGELOG.md +++ b/packages/batch-execute/CHANGELOG.md @@ -1,168 +1,233 @@ # @graphql-tools/batch-execute +## 9.0.1 + +### Patch Changes + +- [`a59fb765`](https://github.com/ardatan/graphql-tools/commit/a59fb765a1256b914f1728283d793d61b66bdf89) + Thanks [@ardatan](https://github.com/ardatan)! - Optimizations to get better performance in query + planning + +- Updated dependencies + [[`a59fb765`](https://github.com/ardatan/graphql-tools/commit/a59fb765a1256b914f1728283d793d61b66bdf89)]: + - @graphql-tools/utils@10.0.5 + ## 9.0.0 ### Major Changes -- [#5274](https://github.com/ardatan/graphql-tools/pull/5274) [`944a68e8`](https://github.com/ardatan/graphql-tools/commit/944a68e8becf9c86b4c97fd17c372d98a285b955) Thanks [@ardatan](https://github.com/ardatan)! - Drop Node 14 support. Require Node.js `>= 16` +- [#5274](https://github.com/ardatan/graphql-tools/pull/5274) + [`944a68e8`](https://github.com/ardatan/graphql-tools/commit/944a68e8becf9c86b4c97fd17c372d98a285b955) + Thanks [@ardatan](https://github.com/ardatan)! - Drop Node 14 support. Require Node.js `>= 16` ### Patch Changes -- Updated dependencies [[`944a68e8`](https://github.com/ardatan/graphql-tools/commit/944a68e8becf9c86b4c97fd17c372d98a285b955), [`944a68e8`](https://github.com/ardatan/graphql-tools/commit/944a68e8becf9c86b4c97fd17c372d98a285b955)]: +- Updated dependencies + [[`944a68e8`](https://github.com/ardatan/graphql-tools/commit/944a68e8becf9c86b4c97fd17c372d98a285b955), + [`944a68e8`](https://github.com/ardatan/graphql-tools/commit/944a68e8becf9c86b4c97fd17c372d98a285b955)]: - @graphql-tools/utils@10.0.0 ## 8.5.22 ### Patch Changes -- [#5220](https://github.com/ardatan/graphql-tools/pull/5220) [`8e80b689`](https://github.com/ardatan/graphql-tools/commit/8e80b6893d2342353731610d5da9db633d806083) Thanks [@ardatan](https://github.com/ardatan)! - Performance improvements +- [#5220](https://github.com/ardatan/graphql-tools/pull/5220) + [`8e80b689`](https://github.com/ardatan/graphql-tools/commit/8e80b6893d2342353731610d5da9db633d806083) + Thanks [@ardatan](https://github.com/ardatan)! - Performance improvements ## 8.5.21 ### Patch Changes -- [`2f342e43`](https://github.com/ardatan/graphql-tools/commit/2f342e430ba0d0097d1d8cb31a6abb97ed46f971) Thanks [@ardatan](https://github.com/ardatan)! - Do not use promises if not async +- [`2f342e43`](https://github.com/ardatan/graphql-tools/commit/2f342e430ba0d0097d1d8cb31a6abb97ed46f971) + Thanks [@ardatan](https://github.com/ardatan)! - Do not use promises if not async ## 8.5.20 ### Patch Changes -- [#5202](https://github.com/ardatan/graphql-tools/pull/5202) [`05c97eb8`](https://github.com/ardatan/graphql-tools/commit/05c97eb888cd4b1ffbd9adb32722cd5b609292a0) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates: +- [#5202](https://github.com/ardatan/graphql-tools/pull/5202) + [`05c97eb8`](https://github.com/ardatan/graphql-tools/commit/05c97eb888cd4b1ffbd9adb32722cd5b609292a0) + Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates: - - Updated dependency [`dataloader@^2.2.2` ↗︎](https://www.npmjs.com/package/dataloader/v/2.2.2) (from `2.2.2`, in `dependencies`) - - Updated dependency [`value-or-promise@^1.0.12` ↗︎](https://www.npmjs.com/package/value-or-promise/v/1.0.12) (from `1.0.12`, in `dependencies`) + - Updated dependency [`dataloader@^2.2.2` ↗︎](https://www.npmjs.com/package/dataloader/v/2.2.2) + (from `2.2.2`, in `dependencies`) + - Updated dependency + [`value-or-promise@^1.0.12` ↗︎](https://www.npmjs.com/package/value-or-promise/v/1.0.12) (from + `1.0.12`, in `dependencies`) -- [#5191](https://github.com/ardatan/graphql-tools/pull/5191) [`f24f018a`](https://github.com/ardatan/graphql-tools/commit/f24f018aa94394766f4201b1964d473d08946bd3) Thanks [@darren-west](https://github.com/darren-west)! - fix: batched executor returns original error when it has no path +- [#5191](https://github.com/ardatan/graphql-tools/pull/5191) + [`f24f018a`](https://github.com/ardatan/graphql-tools/commit/f24f018aa94394766f4201b1964d473d08946bd3) + Thanks [@darren-west](https://github.com/darren-west)! - fix: batched executor returns original + error when it has no path ## 8.5.19 ### Patch Changes -- [`1c95368a`](https://github.com/ardatan/graphql-tools/commit/1c95368aea868be537d956ba5e994cde58dfee41) Thanks [@ardatan](https://github.com/ardatan)! - Use ranged versions for dependencies +- [`1c95368a`](https://github.com/ardatan/graphql-tools/commit/1c95368aea868be537d956ba5e994cde58dfee41) + Thanks [@ardatan](https://github.com/ardatan)! - Use ranged versions for dependencies ## 8.5.18 ### Patch Changes -- [#5055](https://github.com/ardatan/graphql-tools/pull/5055) [`30bd4d0c`](https://github.com/ardatan/graphql-tools/commit/30bd4d0c10f59147faba925dc0941c731b0532a9) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - - Updated dependency [`dataloader@2.2.2` ↗︎](https://www.npmjs.com/package/dataloader/v/2.2.2) (from `2.2.1`, in `dependencies`) +- [#5055](https://github.com/ardatan/graphql-tools/pull/5055) + [`30bd4d0c`](https://github.com/ardatan/graphql-tools/commit/30bd4d0c10f59147faba925dc0941c731b0532a9) + Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: + - Updated dependency [`dataloader@2.2.2` ↗︎](https://www.npmjs.com/package/dataloader/v/2.2.2) + (from `2.2.1`, in `dependencies`) ## 8.5.17 ### Patch Changes -- [#5025](https://github.com/ardatan/graphql-tools/pull/5025) [`b09ea282`](https://github.com/ardatan/graphql-tools/commit/b09ea282f0945fb19f354af57aabddcd23b2a155) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - - Updated dependency [`dataloader@2.2.1` ↗︎](https://www.npmjs.com/package/dataloader/v/2.2.1) (from `2.1.0`, in `dependencies`) -- Updated dependencies [[`b5c8f640`](https://github.com/ardatan/graphql-tools/commit/b5c8f6407b74466ed0d2989000458cb59239e9af)]: +- [#5025](https://github.com/ardatan/graphql-tools/pull/5025) + [`b09ea282`](https://github.com/ardatan/graphql-tools/commit/b09ea282f0945fb19f354af57aabddcd23b2a155) + Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: + - Updated dependency [`dataloader@2.2.1` ↗︎](https://www.npmjs.com/package/dataloader/v/2.2.1) + (from `2.1.0`, in `dependencies`) +- Updated dependencies + [[`b5c8f640`](https://github.com/ardatan/graphql-tools/commit/b5c8f6407b74466ed0d2989000458cb59239e9af)]: - @graphql-tools/utils@9.2.1 ## 8.5.16 ### Patch Changes -- Updated dependencies [[`a94217e9`](https://github.com/ardatan/graphql-tools/commit/a94217e920c5d6237471ab6ad4d96cf230984177), [`62d074be`](https://github.com/ardatan/graphql-tools/commit/62d074be48779b1e096e056ca1233822c421dc99)]: +- Updated dependencies + [[`a94217e9`](https://github.com/ardatan/graphql-tools/commit/a94217e920c5d6237471ab6ad4d96cf230984177), + [`62d074be`](https://github.com/ardatan/graphql-tools/commit/62d074be48779b1e096e056ca1233822c421dc99)]: - @graphql-tools/utils@9.2.0 ## 8.5.15 ### Patch Changes -- [#4943](https://github.com/ardatan/graphql-tools/pull/4943) [`a4d36fcc`](https://github.com/ardatan/graphql-tools/commit/a4d36fccce6113843a55b77c96328727f4c748bc) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: - - Updated dependency [`value-or-promise@1.0.12` ↗︎](https://www.npmjs.com/package/value-or-promise/v/1.0.12) (from `1.0.11`, in `dependencies`) -- Updated dependencies [[`e3ec35ed`](https://github.com/ardatan/graphql-tools/commit/e3ec35ed27d4a329739c8da6be06ce74c8f25591)]: +- [#4943](https://github.com/ardatan/graphql-tools/pull/4943) + [`a4d36fcc`](https://github.com/ardatan/graphql-tools/commit/a4d36fccce6113843a55b77c96328727f4c748bc) + Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: + - Updated dependency + [`value-or-promise@1.0.12` ↗︎](https://www.npmjs.com/package/value-or-promise/v/1.0.12) (from + `1.0.11`, in `dependencies`) +- Updated dependencies + [[`e3ec35ed`](https://github.com/ardatan/graphql-tools/commit/e3ec35ed27d4a329739c8da6be06ce74c8f25591)]: - @graphql-tools/utils@9.1.4 ## 8.5.14 ### Patch Changes -- Updated dependencies [[`904fe770`](https://github.com/ardatan/graphql-tools/commit/904fe770a355ee3d79464c3bbf0375d2dcd64759)]: +- Updated dependencies + [[`904fe770`](https://github.com/ardatan/graphql-tools/commit/904fe770a355ee3d79464c3bbf0375d2dcd64759)]: - @graphql-tools/utils@9.1.3 ## 8.5.13 ### Patch Changes -- Updated dependencies [[`13c24883`](https://github.com/ardatan/graphql-tools/commit/13c24883004d5330f7402cb20566e37535c5729b)]: +- Updated dependencies + [[`13c24883`](https://github.com/ardatan/graphql-tools/commit/13c24883004d5330f7402cb20566e37535c5729b)]: - @graphql-tools/utils@9.1.2 ## 8.5.12 ### Patch Changes -- Updated dependencies [[`7411a5e7`](https://github.com/ardatan/graphql-tools/commit/7411a5e71a8138d9ccfe907b1fb01e62fcbb0cdb)]: +- Updated dependencies + [[`7411a5e7`](https://github.com/ardatan/graphql-tools/commit/7411a5e71a8138d9ccfe907b1fb01e62fcbb0cdb)]: - @graphql-tools/utils@9.1.1 ## 8.5.11 ### Patch Changes -- Updated dependencies [[`c0639dd0`](https://github.com/ardatan/graphql-tools/commit/c0639dd0065db1b5bcedaabf58b11945714bab8d)]: +- Updated dependencies + [[`c0639dd0`](https://github.com/ardatan/graphql-tools/commit/c0639dd0065db1b5bcedaabf58b11945714bab8d)]: - @graphql-tools/utils@9.1.0 ## 8.5.10 ### Patch Changes -- Updated dependencies [[`d83b1960`](https://github.com/ardatan/graphql-tools/commit/d83b19605be71481ccf8effd80d5254423ea811a)]: +- Updated dependencies + [[`d83b1960`](https://github.com/ardatan/graphql-tools/commit/d83b19605be71481ccf8effd80d5254423ea811a)]: - @graphql-tools/utils@9.0.1 ## 8.5.9 ### Patch Changes -- Updated dependencies [[`80836fa7`](https://github.com/ardatan/graphql-tools/commit/80836fa78af3c6e61c61fe4d3bc52831b2c58931), [`8f6d3efc`](https://github.com/ardatan/graphql-tools/commit/8f6d3efc92b25236f5a3a761ea7ba2f0a7c7f550), [`80836fa7`](https://github.com/ardatan/graphql-tools/commit/80836fa78af3c6e61c61fe4d3bc52831b2c58931), [`80836fa7`](https://github.com/ardatan/graphql-tools/commit/80836fa78af3c6e61c61fe4d3bc52831b2c58931), [`80836fa7`](https://github.com/ardatan/graphql-tools/commit/80836fa78af3c6e61c61fe4d3bc52831b2c58931)]: +- Updated dependencies + [[`80836fa7`](https://github.com/ardatan/graphql-tools/commit/80836fa78af3c6e61c61fe4d3bc52831b2c58931), + [`8f6d3efc`](https://github.com/ardatan/graphql-tools/commit/8f6d3efc92b25236f5a3a761ea7ba2f0a7c7f550), + [`80836fa7`](https://github.com/ardatan/graphql-tools/commit/80836fa78af3c6e61c61fe4d3bc52831b2c58931), + [`80836fa7`](https://github.com/ardatan/graphql-tools/commit/80836fa78af3c6e61c61fe4d3bc52831b2c58931), + [`80836fa7`](https://github.com/ardatan/graphql-tools/commit/80836fa78af3c6e61c61fe4d3bc52831b2c58931)]: - @graphql-tools/utils@9.0.0 ## 8.5.8 ### Patch Changes -- Updated dependencies [[`f7daf777`](https://github.com/ardatan/graphql-tools/commit/f7daf7777cc214801886e4a45c0389bc5837d175)]: +- Updated dependencies + [[`f7daf777`](https://github.com/ardatan/graphql-tools/commit/f7daf7777cc214801886e4a45c0389bc5837d175)]: - @graphql-tools/utils@8.13.1 ## 8.5.7 ### Patch Changes -- Updated dependencies [[`df5848b8`](https://github.com/ardatan/graphql-tools/commit/df5848b85102827f004f23aded7cf802cdcde00f), [`df5848b8`](https://github.com/ardatan/graphql-tools/commit/df5848b85102827f004f23aded7cf802cdcde00f), [`df5848b8`](https://github.com/ardatan/graphql-tools/commit/df5848b85102827f004f23aded7cf802cdcde00f)]: +- Updated dependencies + [[`df5848b8`](https://github.com/ardatan/graphql-tools/commit/df5848b85102827f004f23aded7cf802cdcde00f), + [`df5848b8`](https://github.com/ardatan/graphql-tools/commit/df5848b85102827f004f23aded7cf802cdcde00f), + [`df5848b8`](https://github.com/ardatan/graphql-tools/commit/df5848b85102827f004f23aded7cf802cdcde00f)]: - @graphql-tools/utils@8.13.0 ## 8.5.6 ### Patch Changes -- Updated dependencies [[`43c736bd`](https://github.com/ardatan/graphql-tools/commit/43c736bd1865c00898966a7ed14060496c9e6a0c)]: +- Updated dependencies + [[`43c736bd`](https://github.com/ardatan/graphql-tools/commit/43c736bd1865c00898966a7ed14060496c9e6a0c)]: - @graphql-tools/utils@8.12.0 ## 8.5.5 ### Patch Changes -- Updated dependencies [[`71cb4fae`](https://github.com/ardatan/graphql-tools/commit/71cb4faeb0833a228520a7bc2beed8ac7274443f), [`403ed450`](https://github.com/ardatan/graphql-tools/commit/403ed4507eff7cd509f410f7542a702da72e1a9a)]: +- Updated dependencies + [[`71cb4fae`](https://github.com/ardatan/graphql-tools/commit/71cb4faeb0833a228520a7bc2beed8ac7274443f), + [`403ed450`](https://github.com/ardatan/graphql-tools/commit/403ed4507eff7cd509f410f7542a702da72e1a9a)]: - @graphql-tools/utils@8.11.0 ## 8.5.4 ### Patch Changes -- Updated dependencies [[`4fe3d9c0`](https://github.com/ardatan/graphql-tools/commit/4fe3d9c037e9c138bd8a9b04b3977d74eba32c97)]: +- Updated dependencies + [[`4fe3d9c0`](https://github.com/ardatan/graphql-tools/commit/4fe3d9c037e9c138bd8a9b04b3977d74eba32c97)]: - @graphql-tools/utils@8.10.1 ## 8.5.3 ### Patch Changes -- Updated dependencies [[`2609d71f`](https://github.com/ardatan/graphql-tools/commit/2609d71f7c3a0ef2b381c51d9ce60b0de49f9b27)]: +- Updated dependencies + [[`2609d71f`](https://github.com/ardatan/graphql-tools/commit/2609d71f7c3a0ef2b381c51d9ce60b0de49f9b27)]: - @graphql-tools/utils@8.10.0 ## 8.5.2 ### Patch Changes -- [#4624](https://github.com/ardatan/graphql-tools/pull/4624) [`e3167edc`](https://github.com/ardatan/graphql-tools/commit/e3167edc98172fda88ce2306c10c7d4a23d91d67) Thanks [@n1ru4l](https://github.com/n1ru4l)! - Fix CommonJS TypeScript resolution with `moduleResolution` `node16` or `nodenext` +- [#4624](https://github.com/ardatan/graphql-tools/pull/4624) + [`e3167edc`](https://github.com/ardatan/graphql-tools/commit/e3167edc98172fda88ce2306c10c7d4a23d91d67) + Thanks [@n1ru4l](https://github.com/n1ru4l)! - Fix CommonJS TypeScript resolution with + `moduleResolution` `node16` or `nodenext` -- Updated dependencies [[`e3167edc`](https://github.com/ardatan/graphql-tools/commit/e3167edc98172fda88ce2306c10c7d4a23d91d67)]: +- Updated dependencies + [[`e3167edc`](https://github.com/ardatan/graphql-tools/commit/e3167edc98172fda88ce2306c10c7d4a23d91d67)]: - @graphql-tools/utils@8.9.1 ## 8.5.1 @@ -350,7 +415,8 @@ - 631b11bd: refactor(delegationPlanner): introduce static version of our piecemeal planner - ...which, although undocumented, can be accessed within the StitchingInfo object saved in a stitched schema's extensions. + ...which, although undocumented, can be accessed within the StitchingInfo object saved in a + stitched schema's extensions. Also improves memoization technique slightly across the board. @@ -396,13 +462,14 @@ When delegating with delegateToSchema, rootValue can be set multiple ways: - - when using a custom executor, the custom executor can utilize a rootValue in whichever custom way it specifies. - - when using the default executor (execute/subscribe from graphql-js): - -- rootValue can be passed to delegateToSchema via a named option - -- rootValue can be included within a subschemaConfig - -- otherwise, rootValue is inferred from the originating schema + - when using a custom executor, the custom executor can utilize a rootValue in whichever custom + way it specifies. + - when using the default executor (execute/subscribe from graphql-js): -- rootValue can be passed + to delegateToSchema via a named option -- rootValue can be included within a subschemaConfig -- + otherwise, rootValue is inferred from the originating schema - When using wrapSchema/stitchSchemas, a subschemaConfig can specify the createProxyingResolver function which can pass whatever rootValue it wants to delegateToSchema as above. + When using wrapSchema/stitchSchemas, a subschemaConfig can specify the createProxyingResolver + function which can pass whatever rootValue it wants to delegateToSchema as above. - c42e811d: BREAKING CHANGES; @@ -410,21 +477,26 @@ - Add required `operationType: OperationTypeNode` field in `ExecutionRequest` - Add `context` in `createRequest` and `createRequestInfo` instead of `delegateToSchema` - > It doesn't rely on info.operation.operationType to allow the user to call an operation from different root type. - > And it doesn't call getOperationAST again and again to get operation type from the document/operation because we have it in Request and ExecutionParams + > It doesn't rely on info.operation.operationType to allow the user to call an operation from + > different root type. And it doesn't call getOperationAST again and again to get operation type + > from the document/operation because we have it in Request and ExecutionParams > https://github.com/ardatan/graphql-tools/pull/3166/files#diff-d4824895ea613dcc1f710c3ac82e952fe0ca12391b671f70d9f2d90d5656fdceR38 Improvements; - - Memoize `defaultExecutor` for a single `GraphQLSchema` so allow `getBatchingExecutor` to memoize `batchingExecutor` correctly. - - And there is no different `defaultExecutor` is created for `subscription` and other operation types. Only one executor is used. + - Memoize `defaultExecutor` for a single `GraphQLSchema` so allow `getBatchingExecutor` to memoize + `batchingExecutor` correctly. + - And there is no different `defaultExecutor` is created for `subscription` and other operation + types. Only one executor is used. - > Batch executor is memoized by `executor` reference but `createDefaultExecutor` didn't memoize the default executor so this memoization wasn't working correctly on `batch-execute` side. + > Batch executor is memoized by `executor` reference but `createDefaultExecutor` didn't memoize + > the default executor so this memoization wasn't working correctly on `batch-execute` side. > https://github.com/ardatan/graphql-tools/blob/remove-info-executor/packages/batch-execute/src/getBatchingExecutor.ts#L9 - c0ca3190: BREAKING CHANGE - Remove Subscriber and use only Executor - - - Now `Executor` can receive `AsyncIterable` and subscriptions will also be handled by `Executor`. This is a future-proof change for defer, stream and live queries + - - Now `Executor` can receive `AsyncIterable` and subscriptions will also be handled by + `Executor`. This is a future-proof change for defer, stream and live queries ### Patch Changes @@ -478,59 +550,118 @@ #### Schema Generation and Decoration API (`@graphql-tools/schema`) - - Resolver validation options should now be set to `error`, `warn` or `ignore` rather than `true` or `false`. In previous versions, some of the validators caused errors to be thrown, while some issued warnings. This changes brings consistency to validator behavior. + - Resolver validation options should now be set to `error`, `warn` or `ignore` rather than `true` + or `false`. In previous versions, some of the validators caused errors to be thrown, while some + issued warnings. This changes brings consistency to validator behavior. - - The `allowResolversNotInSchema` has been renamed to `requireResolversToMatchSchema`, to harmonize the naming convention of all the validators. The default setting of `requireResolversToMatchSchema` is `error`, matching the previous behavior. + - The `allowResolversNotInSchema` has been renamed to `requireResolversToMatchSchema`, to + harmonize the naming convention of all the validators. The default setting of + `requireResolversToMatchSchema` is `error`, matching the previous behavior. #### Schema Delegation (`delegateToSchema` & `@graphql-tools/delegate`) - - The `delegateToSchema` return value has matured and been formalized as an `ExternalObject`, in which all errors are integrated into the GraphQL response, preserving their initial path. Those advanced users accessing the result directly will note the change in error handling. This also allows for the deprecation of unnecessary helper functions including `slicedError`, `getErrors`, `getErrorsByPathSegment` functions. Only external errors with missing or invalid paths must still be preserved by annotating the remote object with special properties. The new `getUnpathedErrors` function is therefore necessary for retrieving only these errors. Note also the new `annotateExternalObject` and `mergeExternalObjects` functions, as well as the renaming of `handleResult` to `resolveExternalValue`. - - - Transform types and the `applySchemaTransforms` are now relocated to the `delegate` package; `applyRequestTransforms`/`applyResultTransforms` functions have been deprecated, however, as this functionality has been replaced since v6 by the `Transformer` abstraction. - - - The `transformRequest`/`transformResult` methods are now provided additional `delegationContext` and `transformationContext` arguments -- these were introduced in v6, but previously optional. - - - The `transformSchema` method may wish to create additional delegating resolvers and so it is now provided the `subschemaConfig` and final (non-executable) `transformedSchema` parameters. As in v6, the `transformSchema` is kicked off once to produce the non-executable version, and then, if a wrapping schema is being generated, proxying resolvers are created with access to the (non-executable) initial result. In v7, the individual `transformSchema` methods also get access to the result of the first run, if necessary, they can create additional wrapping schema proxying resolvers. - - - `applySchemaTransforms` parameters have been updated to match and support the `transformSchema` parameters above. + - The `delegateToSchema` return value has matured and been formalized as an `ExternalObject`, in + which all errors are integrated into the GraphQL response, preserving their initial path. Those + advanced users accessing the result directly will note the change in error handling. This also + allows for the deprecation of unnecessary helper functions including `slicedError`, `getErrors`, + `getErrorsByPathSegment` functions. Only external errors with missing or invalid paths must + still be preserved by annotating the remote object with special properties. The new + `getUnpathedErrors` function is therefore necessary for retrieving only these errors. Note also + the new `annotateExternalObject` and `mergeExternalObjects` functions, as well as the renaming + of `handleResult` to `resolveExternalValue`. + + - Transform types and the `applySchemaTransforms` are now relocated to the `delegate` package; + `applyRequestTransforms`/`applyResultTransforms` functions have been deprecated, however, as + this functionality has been replaced since v6 by the `Transformer` abstraction. + + - The `transformRequest`/`transformResult` methods are now provided additional `delegationContext` + and `transformationContext` arguments -- these were introduced in v6, but previously optional. + + - The `transformSchema` method may wish to create additional delegating resolvers and so it is now + provided the `subschemaConfig` and final (non-executable) `transformedSchema` parameters. As in + v6, the `transformSchema` is kicked off once to produce the non-executable version, and then, if + a wrapping schema is being generated, proxying resolvers are created with access to the + (non-executable) initial result. In v7, the individual `transformSchema` methods also get access + to the result of the first run, if necessary, they can create additional wrapping schema + proxying resolvers. + + - `applySchemaTransforms` parameters have been updated to match and support the `transformSchema` + parameters above. #### Remote Schemas & Wrapping (`wrapSchema`, `makeRemoteExecutableSchema`, and `@graphql-tools/wrap`) - - `wrapSchema` and `generateProxyingResolvers` now only take a single options argument with named properties of type `SubschemaConfig`. The previously possible shorthand version with first argument consisting of a `GraphQLSchema` and second argument representing the transforms should be reworked as a `SubschemaConfig` object. - - - Similarly, the `ICreateProxyingResolverOptions` interface that provides the options for the `createProxyingResolver` property of `SubschemaConfig` options has been adjusted. The `schema` property previously could be set to a `GraphQLSchema` or a `SubschemaConfig` object. This property has been removed in favor of a `subschemaConfig` property that will always be a `SubschemaConfig` object. The `transforms` property has been removed; transforms should be included within the `SubschemaConfig` object.` - - - The format of the wrapping schema has solidified. All non-root fields are expected to use identical resolvers, either `defaultMergedResolver` or a custom equivalent, with root fields doing the hard work of proxying. Support for custom merged resolvers throught `createMergedResolver` has been deprecated, as custom merging resolvers conflicts when using stitching's type merging, where resolvers are expected to be identical across subschemas. - - - The `WrapFields` transform's `wrappingResolver` option has been removed, as this complicates multiple wrapping layers, as well as planned functionality to wrap subscription root fields in potentially multiple layers, as the wrapping resolvers may be different in different layers. Modifying resolvers can still be performed by use of an additional transform such as `TransformRootFields` or `TransformObjectFields`. - - - The `ExtendSchema` transform has been removed, as it is conceptually simpler just to use `stitchSchemas` with one subschema. - - - The `ReplaceFieldsWithFragment`, `AddFragmentsByField`, `AddSelectionSetsByField`, and `AddMergedTypeSelectionSets` transforms has been removed, as they are superseded by the `AddSelectionSets` and `VisitSelectionSets` transforms. The `AddSelectionSets` purposely takes parsed SDL rather than strings, to nudge end users to parse these strings at build time (when possible), rather than at runtime. Parsing of selection set strings can be performed using the `parseSelectionSet` function from `@graphql-tools/utils`. + - `wrapSchema` and `generateProxyingResolvers` now only take a single options argument with named + properties of type `SubschemaConfig`. The previously possible shorthand version with first + argument consisting of a `GraphQLSchema` and second argument representing the transforms should + be reworked as a `SubschemaConfig` object. + + - Similarly, the `ICreateProxyingResolverOptions` interface that provides the options for the + `createProxyingResolver` property of `SubschemaConfig` options has been adjusted. The `schema` + property previously could be set to a `GraphQLSchema` or a `SubschemaConfig` object. This + property has been removed in favor of a `subschemaConfig` property that will always be a + `SubschemaConfig` object. The `transforms` property has been removed; transforms should be + included within the `SubschemaConfig` object.` + + - The format of the wrapping schema has solidified. All non-root fields are expected to use + identical resolvers, either `defaultMergedResolver` or a custom equivalent, with root fields + doing the hard work of proxying. Support for custom merged resolvers throught + `createMergedResolver` has been deprecated, as custom merging resolvers conflicts when using + stitching's type merging, where resolvers are expected to be identical across subschemas. + + - The `WrapFields` transform's `wrappingResolver` option has been removed, as this complicates + multiple wrapping layers, as well as planned functionality to wrap subscription root fields in + potentially multiple layers, as the wrapping resolvers may be different in different layers. + Modifying resolvers can still be performed by use of an additional transform such as + `TransformRootFields` or `TransformObjectFields`. + + - The `ExtendSchema` transform has been removed, as it is conceptually simpler just to use + `stitchSchemas` with one subschema. + + - The `ReplaceFieldsWithFragment`, `AddFragmentsByField`, `AddSelectionSetsByField`, and + `AddMergedTypeSelectionSets` transforms has been removed, as they are superseded by the + `AddSelectionSets` and `VisitSelectionSets` transforms. The `AddSelectionSets` purposely takes + parsed SDL rather than strings, to nudge end users to parse these strings at build time (when + possible), rather than at runtime. Parsing of selection set strings can be performed using the + `parseSelectionSet` function from `@graphql-tools/utils`. #### Schema Stitching (`stitchSchemas` & `@graphql-tools/stitch`) - - `stitchSchemas`'s `mergeTypes` option is now true by default! This causes the `onTypeConflict` option to be ignored by default. To use `onTypeConflict` to select a specific type instead of simply merging, simply set `mergeTypes` to false. + - `stitchSchemas`'s `mergeTypes` option is now true by default! This causes the `onTypeConflict` + option to be ignored by default. To use `onTypeConflict` to select a specific type instead of + simply merging, simply set `mergeTypes` to false. - - `schemas` argument has been deprecated, use `subschemas`, `typeDefs`, or `types`, depending on what you are stitching. + - `schemas` argument has been deprecated, use `subschemas`, `typeDefs`, or `types`, depending on + what you are stitching. - - When using batch delegation in type merging, the `argsFromKeys` function is now set only via the `argsFromKeys` property. Previously, if `argsFromKeys` was absent, it could be read from `args`. + - When using batch delegation in type merging, the `argsFromKeys` function is now set only via the + `argsFromKeys` property. Previously, if `argsFromKeys` was absent, it could be read from `args`. - Support for fragment hints has been removed in favor of selection set hints. - - `stitchSchemas` now processes all `GraphQLSchema` and `SubschemaConfig` subschema input into new `Subschema` objects, handling schema config directives such aso`@computed` as well as generating the final transformed schema, stored as the `transformedSchema` property, if transforms are used. Signatures of the `onTypeConflict`, `fieldConfigMerger`, and `inputFieldConfigMerger` have been updated to include metadata related to the original and transformed subschemas. Note the property name change for `onTypeConflict` from `schema` to `subschema`. + - `stitchSchemas` now processes all `GraphQLSchema` and `SubschemaConfig` subschema input into new + `Subschema` objects, handling schema config directives such aso`@computed` as well as generating + the final transformed schema, stored as the `transformedSchema` property, if transforms are + used. Signatures of the `onTypeConflict`, `fieldConfigMerger`, and `inputFieldConfigMerger` have + been updated to include metadata related to the original and transformed subschemas. Note the + property name change for `onTypeConflict` from `schema` to `subschema`. #### Mocking (`addMocksToSchema` and `@graphql-tools/mock`) - - Mocks returning objects with fields set as functions are now operating according to upstream graphql-js convention, i.e. these functions take three arguments, `args`, `context`, and `info` with `parent` available as `this` rather than as the first argument. + - Mocks returning objects with fields set as functions are now operating according to upstream + graphql-js convention, i.e. these functions take three arguments, `args`, `context`, and `info` + with `parent` available as `this` rather than as the first argument. #### Other Utilities (`@graphql-tools/utils`) - - `filterSchema`'s `fieldFilter` will now filter _all_ fields across Object, Interface, and Input types. For the previous Object-only behavior, switch to the `objectFieldFilter` option. + - `filterSchema`'s `fieldFilter` will now filter _all_ fields across Object, Interface, and Input + types. For the previous Object-only behavior, switch to the `objectFieldFilter` option. - Unused `fieldNodes` utility functions have been removed. - - Unused `typeContainsSelectionSet` function has been removed, and `typesContainSelectionSet` has been moved to the `stitch` package. - - Unnecessary `Operation` type has been removed in favor of `OperationTypeNode` from upstream graphql-js. - - As above, `applySchemaTransforms`/`applyRequestTransforms`/`applyResultTransforms` have been removed from the `utils` package, as they are implemented elsewhere or no longer necessary. + - Unused `typeContainsSelectionSet` function has been removed, and `typesContainSelectionSet` has + been moved to the `stitch` package. + - Unnecessary `Operation` type has been removed in favor of `OperationTypeNode` from upstream + graphql-js. + - As above, `applySchemaTransforms`/`applyRequestTransforms`/`applyResultTransforms` have been + removed from the `utils` package, as they are implemented elsewhere or no longer necessary. ## Related Issues diff --git a/packages/batch-execute/package.json b/packages/batch-execute/package.json index 62b8d994bbb..4c289fc5ec1 100644 --- a/packages/batch-execute/package.json +++ b/packages/batch-execute/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/batch-execute", - "version": "9.0.0", + "version": "9.0.1", "type": "module", "description": "A set of utils for faster development of GraphQL tools", "repository": { @@ -50,7 +50,7 @@ "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" }, "dependencies": { - "@graphql-tools/utils": "^10.0.0", + "@graphql-tools/utils": "^10.0.5", "dataloader": "^2.2.2", "tslib": "^2.4.0", "value-or-promise": "^1.0.12" diff --git a/packages/delegate/CHANGELOG.md b/packages/delegate/CHANGELOG.md index ba7ee89d6f1..911f4a99ad7 100644 --- a/packages/delegate/CHANGELOG.md +++ b/packages/delegate/CHANGELOG.md @@ -1,5 +1,26 @@ # @graphql-tools/delegate +## 10.0.2 + +### Patch Changes + +- [#5477](https://github.com/ardatan/graphql-tools/pull/5477) + [`cfd47827`](https://github.com/ardatan/graphql-tools/commit/cfd47827c0e625d1b1894e18260342576d6dd71d) + 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`) + +- [`a59fb765`](https://github.com/ardatan/graphql-tools/commit/a59fb765a1256b914f1728283d793d61b66bdf89) + Thanks [@ardatan](https://github.com/ardatan)! - Optimizations to get better performance in query + planning + +- Updated dependencies + [[`a59fb765`](https://github.com/ardatan/graphql-tools/commit/a59fb765a1256b914f1728283d793d61b66bdf89)]: + - @graphql-tools/batch-execute@9.0.1 + - @graphql-tools/utils@10.0.5 + ## 10.0.1 ### Patch Changes diff --git a/packages/delegate/package.json b/packages/delegate/package.json index fe1684fc512..77675540ba1 100644 --- a/packages/delegate/package.json +++ b/packages/delegate/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/delegate", - "version": "10.0.1", + "version": "10.0.2", "type": "module", "description": "A set of utils for faster development of GraphQL tools", "repository": { @@ -50,10 +50,10 @@ "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" }, "dependencies": { - "@graphql-tools/batch-execute": "^9.0.0", + "@graphql-tools/batch-execute": "^9.0.1", "@graphql-tools/executor": "^1.0.0", "@graphql-tools/schema": "^10.0.0", - "@graphql-tools/utils": "^10.0.0", + "@graphql-tools/utils": "^10.0.5", "dataloader": "^2.2.2", "tslib": "^2.5.0" }, diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 50af95658c0..a6493f32c5f 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,5 +1,13 @@ # @graphql-tools/utils +## 10.0.5 + +### Patch Changes + +- [`a59fb765`](https://github.com/ardatan/graphql-tools/commit/a59fb765a1256b914f1728283d793d61b66bdf89) + Thanks [@ardatan](https://github.com/ardatan)! - Optimizations to get better performance in query + planning + ## 10.0.4 ### Patch Changes diff --git a/packages/utils/package.json b/packages/utils/package.json index ea6d9b28343..446cc68c68c 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/utils", - "version": "10.0.4", + "version": "10.0.5", "type": "module", "description": "Common package containing utils and types for GraphQL tools", "repository": {