diff --git a/.changeset/weak-peaches-count.md b/.changeset/weak-peaches-count.md deleted file mode 100644 index 3222cf2c95b..00000000000 --- a/.changeset/weak-peaches-count.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -'@graphql-tools/batch-execute': major -'@graphql-tools/delegate': major -'@graphql-tools/mock': major -'@graphql-tools/schema': major -'@graphql-tools/stitch': major -'@graphql-tools/utils': major -'@graphql-tools/wrap': major -'@graphql-tools/links': patch -'@graphql-tools/merge': patch ---- - -## Breaking Changes: - -#### 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. - -- 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-executabel) 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`. - -#### 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. - -- `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`. - -- 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`. - -#### 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. - -#### 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. -- 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. - -## Related Issues - -- proxy all the errors: #1047, #1641 -- better error handling for merges #2016, #2062 -- fix typings #1614 -- disable implicit schema pruning #1817 -- mocks not working for functions #1807 diff --git a/packages/batch-delegate/CHANGELOG.md b/packages/batch-delegate/CHANGELOG.md index 161f94013cc..5c282adf663 100644 --- a/packages/batch-delegate/CHANGELOG.md +++ b/packages/batch-delegate/CHANGELOG.md @@ -1,6 +1,14 @@ # @graphql-tools/batch-delegate +## 6.2.5 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/delegate@7.0.0 + ## 6.2.4 + ### Patch Changes - 533d6d53: Bump all packages to allow adjustments diff --git a/packages/batch-delegate/package.json b/packages/batch-delegate/package.json index 2e513a93ab3..013e4dc0bc1 100644 --- a/packages/batch-delegate/package.json +++ b/packages/batch-delegate/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/batch-delegate", - "version": "6.2.4", + "version": "6.2.5", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "license": "MIT", @@ -18,14 +18,14 @@ "input": "./src/index.ts" }, "dependencies": { - "@graphql-tools/delegate": "^6.2.4", + "@graphql-tools/delegate": "^7.0.0", "dataloader": "2.0.0", "tslib": "~2.0.1" }, "devDependencies": { - "@graphql-tools/schema": "6.2.4", - "@graphql-tools/stitch": "6.2.4", - "@graphql-tools/utils": "6.2.4" + "@graphql-tools/schema": "7.0.0", + "@graphql-tools/stitch": "7.0.0", + "@graphql-tools/utils": "7.0.0" }, "publishConfig": { "access": "public", diff --git a/packages/batch-execute/CHANGELOG.md b/packages/batch-execute/CHANGELOG.md new file mode 100644 index 00000000000..0068da5300a --- /dev/null +++ b/packages/batch-execute/CHANGELOG.md @@ -0,0 +1,75 @@ +# @graphql-tools/batch-execute + +## 7.0.0 +### Major Changes + +- be1a1575: ## Breaking Changes: + + #### 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. + + - 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-executabel) 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`. + + #### 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. + + - `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`. + + - 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`. + + #### 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. + + #### 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. + - 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. + + ## Related Issues + + - proxy all the errors: #1047, #1641 + - better error handling for merges #2016, #2062 + - fix typings #1614 + - disable implicit schema pruning #1817 + - mocks not working for functions #1807 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/utils@7.0.0 diff --git a/packages/batch-execute/package.json b/packages/batch-execute/package.json index 83a939057d0..5bac6151ddc 100644 --- a/packages/batch-execute/package.json +++ b/packages/batch-execute/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/batch-execute", - "version": "6.2.4", + "version": "7.0.0", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "license": "MIT", @@ -18,7 +18,7 @@ "input": "./src/index.ts" }, "dependencies": { - "@graphql-tools/utils": "^6.2.4", + "@graphql-tools/utils": "^7.0.0", "dataloader": "2.0.0", "is-promise": "4.0.0", "tslib": "~2.0.1" diff --git a/packages/delegate/CHANGELOG.md b/packages/delegate/CHANGELOG.md index a74f55c41cd..325ec5d2b56 100644 --- a/packages/delegate/CHANGELOG.md +++ b/packages/delegate/CHANGELOG.md @@ -1,6 +1,84 @@ # @graphql-tools/delegate +## 7.0.0 + +### Major Changes + +- be1a1575: ## Breaking Changes: + + #### 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. + + - 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-executabel) 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`. + + #### 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. + + - `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`. + + - 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`. + + #### 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. + + #### 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. + - 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. + + ## Related Issues + + - proxy all the errors: #1047, #1641 + - better error handling for merges #2016, #2062 + - fix typings #1614 + - disable implicit schema pruning #1817 + - mocks not working for functions #1807 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/batch-execute@7.0.0 + - @graphql-tools/schema@7.0.0 + - @graphql-tools/utils@7.0.0 + ## 6.2.4 + ### Patch Changes - 32c3c4f8: enhance(stitching): improve error message for unknown types diff --git a/packages/delegate/package.json b/packages/delegate/package.json index 9d25bb64451..fa9cf1a5f4c 100644 --- a/packages/delegate/package.json +++ b/packages/delegate/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/delegate", - "version": "6.2.4", + "version": "7.0.0", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "license": "MIT", @@ -18,9 +18,9 @@ "input": "./src/index.ts" }, "dependencies": { - "@graphql-tools/batch-execute": "^6.2.4", - "@graphql-tools/schema": "^6.2.4", - "@graphql-tools/utils": "^6.2.4", + "@graphql-tools/batch-execute": "^7.0.0", + "@graphql-tools/schema": "^7.0.0", + "@graphql-tools/utils": "^7.0.0", "@ardatan/aggregate-error": "0.0.6", "dataloader": "2.0.0", "is-promise": "4.0.0", diff --git a/packages/graphql-tag-pluck/CHANGELOG.md b/packages/graphql-tag-pluck/CHANGELOG.md index c195486f922..2563a38e87a 100644 --- a/packages/graphql-tag-pluck/CHANGELOG.md +++ b/packages/graphql-tag-pluck/CHANGELOG.md @@ -1,5 +1,12 @@ # @graphql-tools/graphql-tag-pluck +## 6.2.6 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/utils@7.0.0 + ## 6.2.5 ### Patch Changes diff --git a/packages/graphql-tag-pluck/package.json b/packages/graphql-tag-pluck/package.json index 291f47ff524..08fa0fc4e9f 100644 --- a/packages/graphql-tag-pluck/package.json +++ b/packages/graphql-tag-pluck/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/graphql-tag-pluck", - "version": "6.2.5", + "version": "6.2.6", "description": "Pluck graphql-tag template literals", "license": "MIT", "repository": "git@github.com:ardatan/graphql-tools.git", @@ -18,7 +18,7 @@ "@babel/parser": "7.11.5", "@babel/traverse": "7.11.5", "@babel/types": "7.11.5", - "@graphql-tools/utils": "^6.2.4", + "@graphql-tools/utils": "^7.0.0", "tslib": "~2.0.1" }, "optionalDependencies": { diff --git a/packages/graphql-tools/CHANGELOG.md b/packages/graphql-tools/CHANGELOG.md index c449b57d904..a6019654998 100644 --- a/packages/graphql-tools/CHANGELOG.md +++ b/packages/graphql-tools/CHANGELOG.md @@ -1,6 +1,34 @@ # graphql-tools +## 6.2.5 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/batch-execute@7.0.0 + - @graphql-tools/delegate@7.0.0 + - @graphql-tools/mock@7.0.0 + - @graphql-tools/schema@7.0.0 + - @graphql-tools/stitch@7.0.0 + - @graphql-tools/utils@7.0.0 + - @graphql-tools/wrap@7.0.0 + - @graphql-tools/links@6.2.5 + - @graphql-tools/merge@6.2.5 + - @graphql-tools/batch-delegate@6.2.5 + - @graphql-tools/url-loader@6.3.1 + - @graphql-tools/graphql-tag-pluck@6.2.6 + - @graphql-tools/load@6.2.5 + - @graphql-tools/code-file-loader@6.2.5 + - @graphql-tools/git-loader@6.2.5 + - @graphql-tools/github-loader@6.2.5 + - @graphql-tools/graphql-file-loader@6.2.5 + - @graphql-tools/json-file-loader@6.2.5 + - @graphql-tools/module-loader@6.2.5 + - @graphql-tools/relay-operation-optimizer@6.2.5 + - @graphql-tools/resolvers-composition@6.2.5 + ## 6.2.4 + ### Patch Changes - 533d6d53: Bump all packages to allow adjustments diff --git a/packages/graphql-tools/package.json b/packages/graphql-tools/package.json index d93d0330998..040cf86ab95 100644 --- a/packages/graphql-tools/package.json +++ b/packages/graphql-tools/package.json @@ -1,6 +1,6 @@ { "name": "graphql-tools", - "version": "6.2.4", + "version": "6.2.5", "description": "Useful tools to create and manipulate GraphQL schemas.", "repository": "git@github.com:ardatan/graphql-tools.git", "license": "MIT", @@ -19,29 +19,29 @@ "directory": "dist" }, "dependencies": { - "@graphql-tools/batch-delegate": "^6.2.4", - "@graphql-tools/batch-execute": "^6.2.4", - "@graphql-tools/delegate": "^6.2.4", - "@graphql-tools/graphql-tag-pluck": "^6.2.4", + "@graphql-tools/batch-delegate": "^6.2.5", + "@graphql-tools/batch-execute": "^7.0.0", + "@graphql-tools/delegate": "^7.0.0", + "@graphql-tools/graphql-tag-pluck": "^6.2.6", "@graphql-tools/import": "^6.2.4", - "@graphql-tools/links": "^6.2.4", - "@graphql-tools/load": "^6.2.4", - "@graphql-tools/code-file-loader": "^6.2.4", - "@graphql-tools/git-loader": "^6.2.4", - "@graphql-tools/github-loader": "^6.2.4", - "@graphql-tools/graphql-file-loader": "^6.2.4", - "@graphql-tools/json-file-loader": "^6.2.4", - "@graphql-tools/module-loader": "^6.2.4", - "@graphql-tools/url-loader": "^6.2.4", + "@graphql-tools/links": "^6.2.5", + "@graphql-tools/load": "^6.2.5", + "@graphql-tools/code-file-loader": "^6.2.5", + "@graphql-tools/git-loader": "^6.2.5", + "@graphql-tools/github-loader": "^6.2.5", + "@graphql-tools/graphql-file-loader": "^6.2.5", + "@graphql-tools/json-file-loader": "^6.2.5", + "@graphql-tools/module-loader": "^6.2.5", + "@graphql-tools/url-loader": "^6.3.1", "@graphql-tools/load-files": "^6.2.4", - "@graphql-tools/merge": "^6.2.4", - "@graphql-tools/mock": "^6.2.4", - "@graphql-tools/relay-operation-optimizer": "^6.2.4", - "@graphql-tools/resolvers-composition": "^6.2.4", - "@graphql-tools/schema": "^6.2.4", - "@graphql-tools/stitch": "^6.2.4", - "@graphql-tools/utils": "^6.2.4", - "@graphql-tools/wrap": "^6.2.4", + "@graphql-tools/merge": "^6.2.5", + "@graphql-tools/mock": "^7.0.0", + "@graphql-tools/relay-operation-optimizer": "^6.2.5", + "@graphql-tools/resolvers-composition": "^6.2.5", + "@graphql-tools/schema": "^7.0.0", + "@graphql-tools/stitch": "^7.0.0", + "@graphql-tools/utils": "^7.0.0", + "@graphql-tools/wrap": "^7.0.0", "tslib": "~2.0.1" } } diff --git a/packages/links/CHANGELOG.md b/packages/links/CHANGELOG.md index c97fa89cc99..0dbfa9d7468 100644 --- a/packages/links/CHANGELOG.md +++ b/packages/links/CHANGELOG.md @@ -1,6 +1,80 @@ # @graphql-tools/links +## 6.2.5 + +### Patch Changes + +- be1a1575: ## Breaking Changes: + + #### 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. + + - 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-executabel) 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`. + + #### 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. + + - `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`. + + - 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`. + + #### 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. + + #### 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. + - 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. + + ## Related Issues + + - proxy all the errors: #1047, #1641 + - better error handling for merges #2016, #2062 + - fix typings #1614 + - disable implicit schema pruning #1817 + - mocks not working for functions #1807 + +- Updated dependencies [be1a1575] + - @graphql-tools/utils@7.0.0 + ## 6.2.4 + ### Patch Changes - 533d6d53: Bump all packages to allow adjustments diff --git a/packages/links/package.json b/packages/links/package.json index 1f9f82f5d64..805b8d1bc72 100644 --- a/packages/links/package.json +++ b/packages/links/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/links", - "version": "6.2.4", + "version": "6.2.5", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "license": "MIT", @@ -23,7 +23,7 @@ "graphql-upload": "11.0.0" }, "dependencies": { - "@graphql-tools/utils": "^6.2.4", + "@graphql-tools/utils": "^7.0.0", "apollo-link": "1.2.14", "apollo-upload-client": "14.1.2", "cross-fetch": "3.0.6", diff --git a/packages/load/CHANGELOG.md b/packages/load/CHANGELOG.md index 48819fb2b07..6fc236a10b1 100644 --- a/packages/load/CHANGELOG.md +++ b/packages/load/CHANGELOG.md @@ -1,6 +1,15 @@ # @graphql-tools/load +## 6.2.5 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/utils@7.0.0 + - @graphql-tools/merge@6.2.5 + ## 6.2.4 + ### Patch Changes - 533d6d53: Bump all packages to allow adjustments diff --git a/packages/load/package.json b/packages/load/package.json index 91be9facb6b..21c629ec5c0 100644 --- a/packages/load/package.json +++ b/packages/load/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/load", - "version": "6.2.4", + "version": "6.2.5", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "author": "Dotan Simha ", @@ -22,8 +22,8 @@ "graphql-type-json": "0.3.2" }, "dependencies": { - "@graphql-tools/utils": "^6.2.4", - "@graphql-tools/merge": "^6.2.4", + "@graphql-tools/utils": "^7.0.0", + "@graphql-tools/merge": "^6.2.5", "globby": "11.0.1", "import-from": "3.0.0", "is-glob": "4.0.1", diff --git a/packages/loaders/apollo-engine/CHANGELOG.md b/packages/loaders/apollo-engine/CHANGELOG.md index ec0d2e25440..10dbe1a1228 100644 --- a/packages/loaders/apollo-engine/CHANGELOG.md +++ b/packages/loaders/apollo-engine/CHANGELOG.md @@ -1,6 +1,14 @@ # @graphql-tools/apollo-engine-loader +## 6.2.5 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/utils@7.0.0 + ## 6.2.4 + ### Patch Changes - 533d6d53: Bump all packages to allow adjustments diff --git a/packages/loaders/apollo-engine/package.json b/packages/loaders/apollo-engine/package.json index 1ce5a30d961..b5028be7847 100644 --- a/packages/loaders/apollo-engine/package.json +++ b/packages/loaders/apollo-engine/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/apollo-engine-loader", - "version": "6.2.4", + "version": "6.2.5", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "author": "Dotan Simha ", @@ -16,7 +16,7 @@ "graphql": "^14.0.0 || ^15.0.0" }, "dependencies": { - "@graphql-tools/utils": "^6.2.4", + "@graphql-tools/utils": "^7.0.0", "cross-fetch": "3.0.6", "tslib": "~2.0.1" }, diff --git a/packages/loaders/code-file/CHANGELOG.md b/packages/loaders/code-file/CHANGELOG.md index cb893c7cbfd..d9d4c23cbfe 100644 --- a/packages/loaders/code-file/CHANGELOG.md +++ b/packages/loaders/code-file/CHANGELOG.md @@ -1,6 +1,15 @@ # @graphql-tools/code-file-loader +## 6.2.5 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/utils@7.0.0 + - @graphql-tools/graphql-tag-pluck@6.2.6 + ## 6.2.4 + ### Patch Changes - 533d6d53: Bump all packages to allow adjustments diff --git a/packages/loaders/code-file/package.json b/packages/loaders/code-file/package.json index a8357190fba..11d0fa53d6d 100644 --- a/packages/loaders/code-file/package.json +++ b/packages/loaders/code-file/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/code-file-loader", - "version": "6.2.4", + "version": "6.2.5", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "author": "Dotan Simha ", @@ -16,8 +16,8 @@ "graphql": "^14.0.0 || ^15.0.0" }, "dependencies": { - "@graphql-tools/utils": "^6.2.4", - "@graphql-tools/graphql-tag-pluck": "^6.2.4", + "@graphql-tools/utils": "^7.0.0", + "@graphql-tools/graphql-tag-pluck": "^6.2.6", "fs-extra": "9.0.1", "tslib": "~2.0.1" }, diff --git a/packages/loaders/git/CHANGELOG.md b/packages/loaders/git/CHANGELOG.md index 7bc0acd2ef9..2cbdb2e2466 100644 --- a/packages/loaders/git/CHANGELOG.md +++ b/packages/loaders/git/CHANGELOG.md @@ -1,6 +1,15 @@ # @graphql-tools/git-loader +## 6.2.5 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/utils@7.0.0 + - @graphql-tools/graphql-tag-pluck@6.2.6 + ## 6.2.4 + ### Patch Changes - 533d6d53: Bump all packages to allow adjustments diff --git a/packages/loaders/git/package.json b/packages/loaders/git/package.json index 2bb8948c9e9..05e55577783 100644 --- a/packages/loaders/git/package.json +++ b/packages/loaders/git/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/git-loader", - "version": "6.2.4", + "version": "6.2.5", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "author": "Dotan Simha ", @@ -16,8 +16,8 @@ "graphql": "^14.0.0 || ^15.0.0" }, "dependencies": { - "@graphql-tools/utils": "^6.2.4", - "@graphql-tools/graphql-tag-pluck": "^6.2.4", + "@graphql-tools/utils": "^7.0.0", + "@graphql-tools/graphql-tag-pluck": "^6.2.6", "tslib": "~2.0.1" }, "publishConfig": { diff --git a/packages/loaders/github/CHANGELOG.md b/packages/loaders/github/CHANGELOG.md index f37aa786aa1..b257aaf36df 100644 --- a/packages/loaders/github/CHANGELOG.md +++ b/packages/loaders/github/CHANGELOG.md @@ -1,6 +1,15 @@ # @graphql-tools/github-loader +## 6.2.5 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/utils@7.0.0 + - @graphql-tools/graphql-tag-pluck@6.2.6 + ## 6.2.4 + ### Patch Changes - 533d6d53: Bump all packages to allow adjustments diff --git a/packages/loaders/github/package.json b/packages/loaders/github/package.json index 9cce12f89fa..bdde3b25052 100644 --- a/packages/loaders/github/package.json +++ b/packages/loaders/github/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/github-loader", - "version": "6.2.4", + "version": "6.2.5", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "author": "Dotan Simha ", @@ -16,8 +16,8 @@ "graphql": "^14.0.0 || ^15.0.0" }, "dependencies": { - "@graphql-tools/utils": "^6.2.4", - "@graphql-tools/graphql-tag-pluck": "^6.2.4", + "@graphql-tools/utils": "^7.0.0", + "@graphql-tools/graphql-tag-pluck": "^6.2.6", "cross-fetch": "3.0.6", "tslib": "~2.0.1" }, diff --git a/packages/loaders/graphql-file/CHANGELOG.md b/packages/loaders/graphql-file/CHANGELOG.md index d20cd860b99..b1fee22ae16 100644 --- a/packages/loaders/graphql-file/CHANGELOG.md +++ b/packages/loaders/graphql-file/CHANGELOG.md @@ -1,6 +1,14 @@ # @graphql-tools/graphql-file-loader +## 6.2.5 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/utils@7.0.0 + ## 6.2.4 + ### Patch Changes - 533d6d53: Bump all packages to allow adjustments diff --git a/packages/loaders/graphql-file/package.json b/packages/loaders/graphql-file/package.json index e096441ea5a..23ce9bcbd7f 100644 --- a/packages/loaders/graphql-file/package.json +++ b/packages/loaders/graphql-file/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/graphql-file-loader", - "version": "6.2.4", + "version": "6.2.5", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "author": "Dotan Simha ", @@ -20,7 +20,7 @@ }, "dependencies": { "@graphql-tools/import": "^6.2.4", - "@graphql-tools/utils": "^6.2.4", + "@graphql-tools/utils": "^7.0.0", "fs-extra": "9.0.1", "tslib": "~2.0.1" }, diff --git a/packages/loaders/json-file/CHANGELOG.md b/packages/loaders/json-file/CHANGELOG.md index 66cb829d71e..701cd3fc8c0 100644 --- a/packages/loaders/json-file/CHANGELOG.md +++ b/packages/loaders/json-file/CHANGELOG.md @@ -1,6 +1,14 @@ # @graphql-tools/json-file-loader +## 6.2.5 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/utils@7.0.0 + ## 6.2.4 + ### Patch Changes - 533d6d53: Bump all packages to allow adjustments diff --git a/packages/loaders/json-file/package.json b/packages/loaders/json-file/package.json index c4f5acc1562..7f56cead28e 100644 --- a/packages/loaders/json-file/package.json +++ b/packages/loaders/json-file/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/json-file-loader", - "version": "6.2.4", + "version": "6.2.5", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "author": "Dotan Simha ", @@ -16,7 +16,7 @@ "graphql": "^14.0.0 || ^15.0.0" }, "dependencies": { - "@graphql-tools/utils": "^6.2.4", + "@graphql-tools/utils": "^7.0.0", "fs-extra": "9.0.1", "tslib": "~2.0.1" }, diff --git a/packages/loaders/module/CHANGELOG.md b/packages/loaders/module/CHANGELOG.md index 8d0f8ec426e..a575e3e8895 100644 --- a/packages/loaders/module/CHANGELOG.md +++ b/packages/loaders/module/CHANGELOG.md @@ -1,6 +1,14 @@ # @graphql-tools/module-loader +## 6.2.5 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/utils@7.0.0 + ## 6.2.4 + ### Patch Changes - 533d6d53: Bump all packages to allow adjustments diff --git a/packages/loaders/module/package.json b/packages/loaders/module/package.json index b84f465ba6d..c06e07564a1 100644 --- a/packages/loaders/module/package.json +++ b/packages/loaders/module/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/module-loader", - "version": "6.2.4", + "version": "6.2.5", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "author": "Dotan Simha ", @@ -16,7 +16,7 @@ "graphql": "^14.0.0 || ^15.0.0" }, "dependencies": { - "@graphql-tools/utils": "^6.2.4", + "@graphql-tools/utils": "^7.0.0", "tslib": "~2.0.1" }, "publishConfig": { diff --git a/packages/loaders/prisma/CHANGELOG.md b/packages/loaders/prisma/CHANGELOG.md index 33f86fb1dd2..e58b2a59ce6 100644 --- a/packages/loaders/prisma/CHANGELOG.md +++ b/packages/loaders/prisma/CHANGELOG.md @@ -1,6 +1,15 @@ # @graphql-tools/prisma-loader +## 6.2.5 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/utils@7.0.0 + - @graphql-tools/url-loader@6.3.1 + ## 6.2.4 + ### Patch Changes - 533d6d53: Bump all packages to allow adjustments diff --git a/packages/loaders/prisma/package.json b/packages/loaders/prisma/package.json index 14ffc7478cb..b7c785667af 100644 --- a/packages/loaders/prisma/package.json +++ b/packages/loaders/prisma/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/prisma-loader", - "version": "6.2.4", + "version": "6.2.5", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "author": "Dotan Simha ", @@ -16,8 +16,8 @@ "graphql": "^14.0.0 || ^15.0.0" }, "dependencies": { - "@graphql-tools/url-loader": "^6.2.4", - "@graphql-tools/utils": "^6.2.4", + "@graphql-tools/url-loader": "^6.3.1", + "@graphql-tools/utils": "^7.0.0", "@types/http-proxy-agent": "^2.0.2", "@types/js-yaml": "^3.12.5", "@types/json-stable-stringify": "^1.0.32", diff --git a/packages/loaders/url/CHANGELOG.md b/packages/loaders/url/CHANGELOG.md index 0f915b4454e..4bdbb245dd5 100644 --- a/packages/loaders/url/CHANGELOG.md +++ b/packages/loaders/url/CHANGELOG.md @@ -1,5 +1,14 @@ # @graphql-tools/url-loader +## 6.3.1 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/delegate@7.0.0 + - @graphql-tools/utils@7.0.0 + - @graphql-tools/wrap@7.0.0 + ## 6.3.0 ### Minor Changes diff --git a/packages/loaders/url/package.json b/packages/loaders/url/package.json index 9a74f0a8155..7f786d37d5e 100644 --- a/packages/loaders/url/package.json +++ b/packages/loaders/url/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/url-loader", - "version": "6.3.0", + "version": "6.3.1", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "author": "Dotan Simha ", @@ -23,9 +23,9 @@ "supertest": "5.0.0" }, "dependencies": { - "@graphql-tools/delegate": "^6.2.4", - "@graphql-tools/wrap": "^6.2.4", - "@graphql-tools/utils": "^6.2.4", + "@graphql-tools/delegate": "^7.0.0", + "@graphql-tools/wrap": "^7.0.0", + "@graphql-tools/utils": "^7.0.0", "@types/websocket": "1.0.1", "cross-fetch": "3.0.6", "tslib": "~2.0.1", diff --git a/packages/merge/CHANGELOG.md b/packages/merge/CHANGELOG.md index 686ee7527ba..e247ce07814 100644 --- a/packages/merge/CHANGELOG.md +++ b/packages/merge/CHANGELOG.md @@ -1,6 +1,81 @@ # @graphql-tools/merge +## 6.2.5 + +### Patch Changes + +- be1a1575: ## Breaking Changes: + + #### 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. + + - 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-executabel) 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`. + + #### 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. + + - `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`. + + - 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`. + + #### 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. + + #### 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. + - 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. + + ## Related Issues + + - proxy all the errors: #1047, #1641 + - better error handling for merges #2016, #2062 + - fix typings #1614 + - disable implicit schema pruning #1817 + - mocks not working for functions #1807 + +- Updated dependencies [be1a1575] + - @graphql-tools/schema@7.0.0 + - @graphql-tools/utils@7.0.0 + ## 6.2.4 + ### Patch Changes - 32c3c4f8: Fix duplication of scalar directives in merge diff --git a/packages/merge/package.json b/packages/merge/package.json index 7112e619c30..cd6863a71cd 100644 --- a/packages/merge/package.json +++ b/packages/merge/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/merge", - "version": "6.2.4", + "version": "6.2.5", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "author": "Dotan Simha ", @@ -19,8 +19,8 @@ "input": "./src/index.ts" }, "dependencies": { - "@graphql-tools/schema": "^6.2.4", - "@graphql-tools/utils": "^6.2.4", + "@graphql-tools/schema": "^7.0.0", + "@graphql-tools/utils": "^7.0.0", "tslib": "~2.0.1" }, "publishConfig": { diff --git a/packages/mock/CHANGELOG.md b/packages/mock/CHANGELOG.md index 64bf0b42308..a5181e648c9 100644 --- a/packages/mock/CHANGELOG.md +++ b/packages/mock/CHANGELOG.md @@ -1,6 +1,83 @@ # @graphql-tools/mock +## 7.0.0 + +### Major Changes + +- be1a1575: ## Breaking Changes: + + #### 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. + + - 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-executabel) 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`. + + #### 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. + + - `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`. + + - 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`. + + #### 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. + + #### 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. + - 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. + + ## Related Issues + + - proxy all the errors: #1047, #1641 + - better error handling for merges #2016, #2062 + - fix typings #1614 + - disable implicit schema pruning #1817 + - mocks not working for functions #1807 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/schema@7.0.0 + - @graphql-tools/utils@7.0.0 + ## 6.2.4 + ### Patch Changes - 533d6d53: Bump all packages to allow adjustments diff --git a/packages/mock/package.json b/packages/mock/package.json index 506ac006367..b373a05f4fb 100644 --- a/packages/mock/package.json +++ b/packages/mock/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/mock", - "version": "6.2.4", + "version": "7.0.0", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "license": "MIT", @@ -18,8 +18,8 @@ "input": "./src/index.ts" }, "dependencies": { - "@graphql-tools/schema": "^6.2.4", - "@graphql-tools/utils": "^6.2.4", + "@graphql-tools/schema": "^7.0.0", + "@graphql-tools/utils": "^7.0.0", "tslib": "~2.0.1" }, "devDependencies": { diff --git a/packages/relay-operation-optimizer/CHANGELOG.md b/packages/relay-operation-optimizer/CHANGELOG.md index 7fb1812c908..bb65b805254 100644 --- a/packages/relay-operation-optimizer/CHANGELOG.md +++ b/packages/relay-operation-optimizer/CHANGELOG.md @@ -1,6 +1,14 @@ # @graphql-tools/relay-operation-optimizer +## 6.2.5 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/utils@7.0.0 + ## 6.2.4 + ### Patch Changes - 533d6d53: Bump all packages to allow adjustments diff --git a/packages/relay-operation-optimizer/package.json b/packages/relay-operation-optimizer/package.json index 3cb798629be..da4ad0ea9fc 100644 --- a/packages/relay-operation-optimizer/package.json +++ b/packages/relay-operation-optimizer/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/relay-operation-optimizer", - "version": "6.2.4", + "version": "6.2.5", "description": "Package for optimizing your GraphQL operations relay style.", "author": { "name": "Laurin Quast", @@ -27,7 +27,7 @@ "graphql": "^14.0.0 || ^15.0.0" }, "dependencies": { - "@graphql-tools/utils": "^6.2.4", + "@graphql-tools/utils": "^7.0.0", "relay-compiler": "10.0.1", "tslib": "~2.0.1" }, diff --git a/packages/resolvers-composition/CHANGELOG.md b/packages/resolvers-composition/CHANGELOG.md index 52f9e3abab7..f65fee4f807 100644 --- a/packages/resolvers-composition/CHANGELOG.md +++ b/packages/resolvers-composition/CHANGELOG.md @@ -1,6 +1,14 @@ # @graphql-tools/resolvers-composition +## 6.2.5 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/utils@7.0.0 + ## 6.2.4 + ### Patch Changes - 533d6d53: Bump all packages to allow adjustments diff --git a/packages/resolvers-composition/package.json b/packages/resolvers-composition/package.json index 9edca04d58e..77b929bfa96 100644 --- a/packages/resolvers-composition/package.json +++ b/packages/resolvers-composition/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/resolvers-composition", - "version": "6.2.4", + "version": "6.2.5", "description": "Common package containting utils and types for GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "author": "Dotan Simha ", @@ -19,7 +19,7 @@ "@types/lodash": "4.14.162" }, "dependencies": { - "@graphql-tools/utils": "^6.2.4", + "@graphql-tools/utils": "^7.0.0", "lodash": "4.17.20", "tslib": "~2.0.1" }, diff --git a/packages/schema/CHANGELOG.md b/packages/schema/CHANGELOG.md index 3b58ecdfb72..8805e07eb0a 100644 --- a/packages/schema/CHANGELOG.md +++ b/packages/schema/CHANGELOG.md @@ -1,6 +1,82 @@ # @graphql-tools/schema +## 7.0.0 + +### Major Changes + +- be1a1575: ## Breaking Changes: + + #### 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. + + - 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-executabel) 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`. + + #### 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. + + - `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`. + + - 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`. + + #### 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. + + #### 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. + - 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. + + ## Related Issues + + - proxy all the errors: #1047, #1641 + - better error handling for merges #2016, #2062 + - fix typings #1614 + - disable implicit schema pruning #1817 + - mocks not working for functions #1807 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/utils@7.0.0 + ## 6.2.4 + ### Patch Changes - 533d6d53: Bump all packages to allow adjustments diff --git a/packages/schema/package.json b/packages/schema/package.json index 219e9f12144..19bb306f0f9 100644 --- a/packages/schema/package.json +++ b/packages/schema/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/schema", - "version": "6.2.4", + "version": "7.0.0", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "license": "MIT", @@ -21,7 +21,7 @@ "input": "./src/index.ts" }, "dependencies": { - "@graphql-tools/utils": "^6.2.4", + "@graphql-tools/utils": "^7.0.0", "tslib": "~2.0.1" }, "publishConfig": { diff --git a/packages/stitch/CHANGELOG.md b/packages/stitch/CHANGELOG.md index 5075a0f080e..50e58014c3b 100644 --- a/packages/stitch/CHANGELOG.md +++ b/packages/stitch/CHANGELOG.md @@ -1,6 +1,87 @@ # @graphql-tools/stitch +## 7.0.0 + +### Major Changes + +- be1a1575: ## Breaking Changes: + + #### 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. + + - 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-executabel) 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`. + + #### 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. + + - `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`. + + - 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`. + + #### 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. + + #### 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. + - 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. + + ## Related Issues + + - proxy all the errors: #1047, #1641 + - better error handling for merges #2016, #2062 + - fix typings #1614 + - disable implicit schema pruning #1817 + - mocks not working for functions #1807 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/delegate@7.0.0 + - @graphql-tools/schema@7.0.0 + - @graphql-tools/utils@7.0.0 + - @graphql-tools/wrap@7.0.0 + - @graphql-tools/merge@6.2.5 + - @graphql-tools/batch-delegate@6.2.5 + ## 6.2.4 + ### Patch Changes - 32c3c4f8: enhance(HoistFields): allow arguments diff --git a/packages/stitch/package.json b/packages/stitch/package.json index 5522284d3ad..53948c8ba8e 100644 --- a/packages/stitch/package.json +++ b/packages/stitch/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/stitch", - "version": "6.2.4", + "version": "7.0.0", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "license": "MIT", @@ -21,12 +21,12 @@ "dataloader": "2.0.0" }, "dependencies": { - "@graphql-tools/batch-delegate": "^6.2.4", - "@graphql-tools/delegate": "^6.2.4", - "@graphql-tools/merge": "^6.2.4", - "@graphql-tools/schema": "^6.2.4", - "@graphql-tools/utils": "^6.2.4", - "@graphql-tools/wrap": "^6.2.4", + "@graphql-tools/batch-delegate": "^6.2.5", + "@graphql-tools/delegate": "^7.0.0", + "@graphql-tools/merge": "^6.2.5", + "@graphql-tools/schema": "^7.0.0", + "@graphql-tools/utils": "^7.0.0", + "@graphql-tools/wrap": "^7.0.0", "is-promise": "4.0.0", "tslib": "~2.0.1" }, diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 4021c64faf4..b5937732787 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,6 +1,77 @@ # @graphql-tools/utils +## 7.0.0 + +### Major Changes + +- be1a1575: ## Breaking Changes: + + #### 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. + + - 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-executabel) 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`. + + #### 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. + + - `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`. + + - 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`. + + #### 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. + + #### 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. + - 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. + + ## Related Issues + + - proxy all the errors: #1047, #1641 + - better error handling for merges #2016, #2062 + - fix typings #1614 + - disable implicit schema pruning #1817 + - mocks not working for functions #1807 + ## 6.2.4 + ### Patch Changes - 32c3c4f8: Fix duplication of scalar directives in merge diff --git a/packages/utils/package.json b/packages/utils/package.json index cad9d0308da..20cc8dc7d1e 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/utils", - "version": "6.2.4", + "version": "7.0.0", "description": "Common package containting utils and types for GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "author": "Dotan Simha ", diff --git a/packages/wrap/CHANGELOG.md b/packages/wrap/CHANGELOG.md index f3c919f2acd..0088c0367dc 100644 --- a/packages/wrap/CHANGELOG.md +++ b/packages/wrap/CHANGELOG.md @@ -1,6 +1,84 @@ # @graphql-tools/wrap +## 7.0.0 + +### Major Changes + +- be1a1575: ## Breaking Changes: + + #### 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. + + - 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-executabel) 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`. + + #### 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. + + - `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`. + + - 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`. + + #### 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. + + #### 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. + - 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. + + ## Related Issues + + - proxy all the errors: #1047, #1641 + - better error handling for merges #2016, #2062 + - fix typings #1614 + - disable implicit schema pruning #1817 + - mocks not working for functions #1807 + +### Patch Changes + +- Updated dependencies [be1a1575] + - @graphql-tools/delegate@7.0.0 + - @graphql-tools/schema@7.0.0 + - @graphql-tools/utils@7.0.0 + ## 6.2.4 + ### Patch Changes - 32c3c4f8: enhance(HoistFields): allow arguments diff --git a/packages/wrap/package.json b/packages/wrap/package.json index 8fbc93ca906..d82fc30c4ac 100644 --- a/packages/wrap/package.json +++ b/packages/wrap/package.json @@ -1,6 +1,6 @@ { "name": "@graphql-tools/wrap", - "version": "6.2.4", + "version": "7.0.0", "description": "A set of utils for faster development of GraphQL tools", "repository": "git@github.com:ardatan/graphql-tools.git", "license": "MIT", @@ -18,9 +18,9 @@ "input": "./src/index.ts" }, "dependencies": { - "@graphql-tools/delegate": "^6.2.4", - "@graphql-tools/schema": "^6.2.4", - "@graphql-tools/utils": "^6.2.4", + "@graphql-tools/delegate": "^7.0.0", + "@graphql-tools/schema": "^7.0.0", + "@graphql-tools/utils": "^7.0.0", "is-promise": "4.0.0", "tslib": "~2.0.1" },