Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.
Releases
@graphql-tools/batch-execute@7.0.0
Major Changes
be1a157: ## Breaking Changes:
Schema Generation and Decoration API (
@graphql-tools/schema
)Resolver validation options should now be set to
error
,warn
orignore
rather thantrue
orfalse
. 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 torequireResolversToMatchSchema
, to harmonize the naming convention of all the validators. The default setting ofrequireResolversToMatchSchema
iserror
, matching the previous behavior.Schema Delegation (
delegateToSchema
&@graphql-tools/delegate
)The
delegateToSchema
return value has matured and been formalized as anExternalObject
, 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 includingslicedError
,getErrors
,getErrorsByPathSegment
functions. Only external errors with missing or invalid paths must still be preserved by annotating the remote object with special properties. The newgetUnpathedErrors
function is therefore necessary for retrieving only these errors. Note also the newannotateExternalObject
andmergeExternalObjects
functions, as well as the renaming ofhandleResult
toresolveExternalValue
.Transform types and the
applySchemaTransforms
are now relocated to thedelegate
package;applyRequestTransforms
/applyResultTransforms
functions have been deprecated, however, as this functionality has been replaced since v6 by theTransformer
abstraction.The
transformRequest
/transformResult
methods are now provided additionaldelegationContext
andtransformationContext
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 thesubschemaConfig
and final (non-executable)transformedSchema
parameters. As in v6, thetransformSchema
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 individualtransformSchema
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 thetransformSchema
parameters above.Remote Schemas & Wrapping (
wrapSchema
,makeRemoteExecutableSchema
, and@graphql-tools/wrap
)wrapSchema
andgenerateProxyingResolvers
now only take a single options argument with named properties of typeSubschemaConfig
. The previously possible shorthand version with first argument consisting of aGraphQLSchema
and second argument representing the transforms should be reworked as aSubschemaConfig
object.Similarly, the
ICreateProxyingResolverOptions
interface that provides the options for thecreateProxyingResolver
property ofSubschemaConfig
options has been adjusted. Theschema
property previously could be set to aGraphQLSchema
or aSubschemaConfig
object. This property has been removed in favor of asubschemaConfig
property that will always be aSubschemaConfig
object. Thetransforms
property has been removed; transforms should be included within theSubschemaConfig
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 throughtcreateMergedResolver
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'swrappingResolver
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 asTransformRootFields
orTransformObjectFields
.The
ExtendSchema
transform has been removed, as it is conceptually simpler just to usestitchSchemas
with one subschema.The
ReplaceFieldsWithFragment
,AddFragmentsByField
,AddSelectionSetsByField
, andAddMergedTypeSelectionSets
transforms has been removed, as they are superseded by theAddSelectionSets
andVisitSelectionSets
transforms. TheAddSelectionSets
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 theparseSelectionSet
function from@graphql-tools/utils
.Schema Stitching (
stitchSchemas
&@graphql-tools/stitch
)stitchSchemas
'smergeTypes
option is now true by default! This causes theonTypeConflict
option to be ignored by default. To useonTypeConflict
to select a specific type instead of simply merging, simply setmergeTypes
to false.schemas
argument has been deprecated, usesubschemas
,typeDefs
, ortypes
, depending on what you are stitching.When using batch delegation in type merging, the
argsFromKeys
function is now set only via theargsFromKeys
property. Previously, ifargsFromKeys
was absent, it could be read fromargs
.Support for fragment hints has been removed in favor of selection set hints.
stitchSchemas
now processes allGraphQLSchema
andSubschemaConfig
subschema input into newSubschema
objects, handling schema config directives such aso@computed
as well as generating the final transformed schema, stored as thetransformedSchema
property, if transforms are used. Signatures of theonTypeConflict
,fieldConfigMerger
, andinputFieldConfigMerger
have been updated to include metadata related to the original and transformed subschemas. Note the property name change foronTypeConflict
fromschema
tosubschema
.Mocking (
addMocksToSchema
and@graphql-tools/mock
)args
,context
, andinfo
withparent
available asthis
rather than as the first argument.Other Utilities (
@graphql-tools/utils
)filterSchema
'sfieldFilter
will now filter all fields across Object, Interface, and Input types. For the previous Object-only behavior, switch to theobjectFieldFilter
option.fieldNodes
utility functions have been removed.typeContainsSelectionSet
function has been removed, andtypesContainSelectionSet
has been moved to thestitch
package.Operation
type has been removed in favor ofOperationTypeNode
from upstream graphql-js.applySchemaTransforms
/applyRequestTransforms
/applyResultTransforms
have been removed from theutils
package, as they are implemented elsewhere or no longer necessary.Related Issues
Patch Changes
@graphql-tools/delegate@7.0.0
Major Changes
be1a157: ## Breaking Changes:
Schema Generation and Decoration API (
@graphql-tools/schema
)Resolver validation options should now be set to
error
,warn
orignore
rather thantrue
orfalse
. 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 torequireResolversToMatchSchema
, to harmonize the naming convention of all the validators. The default setting ofrequireResolversToMatchSchema
iserror
, matching the previous behavior.Schema Delegation (
delegateToSchema
&@graphql-tools/delegate
)The
delegateToSchema
return value has matured and been formalized as anExternalObject
, 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 includingslicedError
,getErrors
,getErrorsByPathSegment
functions. Only external errors with missing or invalid paths must still be preserved by annotating the remote object with special properties. The newgetUnpathedErrors
function is therefore necessary for retrieving only these errors. Note also the newannotateExternalObject
andmergeExternalObjects
functions, as well as the renaming ofhandleResult
toresolveExternalValue
.Transform types and the
applySchemaTransforms
are now relocated to thedelegate
package;applyRequestTransforms
/applyResultTransforms
functions have been deprecated, however, as this functionality has been replaced since v6 by theTransformer
abstraction.The
transformRequest
/transformResult
methods are now provided additionaldelegationContext
andtransformationContext
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 thesubschemaConfig
and final (non-executable)transformedSchema
parameters. As in v6, thetransformSchema
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 individualtransformSchema
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 thetransformSchema
parameters above.Remote Schemas & Wrapping (
wrapSchema
,makeRemoteExecutableSchema
, and@graphql-tools/wrap
)wrapSchema
andgenerateProxyingResolvers
now only take a single options argument with named properties of typeSubschemaConfig
. The previously possible shorthand version with first argument consisting of aGraphQLSchema
and second argument representing the transforms should be reworked as aSubschemaConfig
object.Similarly, the
ICreateProxyingResolverOptions
interface that provides the options for thecreateProxyingResolver
property ofSubschemaConfig
options has been adjusted. Theschema
property previously could be set to aGraphQLSchema
or aSubschemaConfig
object. This property has been removed in favor of asubschemaConfig
property that will always be aSubschemaConfig
object. Thetransforms
property has been removed; transforms should be included within theSubschemaConfig
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 throughtcreateMergedResolver
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'swrappingResolver
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 asTransformRootFields
orTransformObjectFields
.The
ExtendSchema
transform has been removed, as it is conceptually simpler just to usestitchSchemas
with one subschema.The
ReplaceFieldsWithFragment
,AddFragmentsByField
,AddSelectionSetsByField
, andAddMergedTypeSelectionSets
transforms has been removed, as they are superseded by theAddSelectionSets
andVisitSelectionSets
transforms. TheAddSelectionSets
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 theparseSelectionSet
function from@graphql-tools/utils
.Schema Stitching (
stitchSchemas
&@graphql-tools/stitch
)stitchSchemas
'smergeTypes
option is now true by default! This causes theonTypeConflict
option to be ignored by default. To useonTypeConflict
to select a specific type instead of simply merging, simply setmergeTypes
to false.schemas
argument has been deprecated, usesubschemas
,typeDefs
, ortypes
, depending on what you are stitching.When using batch delegation in type merging, the
argsFromKeys
function is now set only via theargsFromKeys
property. Previously, ifargsFromKeys
was absent, it could be read fromargs
.Support for fragment hints has been removed in favor of selection set hints.
stitchSchemas
now processes allGraphQLSchema
andSubschemaConfig
subschema input into newSubschema
objects, handling schema config directives such aso@computed
as well as generating the final transformed schema, stored as thetransformedSchema
property, if transforms are used. Signatures of theonTypeConflict
,fieldConfigMerger
, andinputFieldConfigMerger
have been updated to include metadata related to the original and transformed subschemas. Note the property name change foronTypeConflict
fromschema
tosubschema
.Mocking (
addMocksToSchema
and@graphql-tools/mock
)args
,context
, andinfo
withparent
available asthis
rather than as the first argument.Other Utilities (
@graphql-tools/utils
)filterSchema
'sfieldFilter
will now filter all fields across Object, Interface, and Input types. For the previous Object-only behavior, switch to theobjectFieldFilter
option.fieldNodes
utility functions have been removed.typeContainsSelectionSet
function has been removed, andtypesContainSelectionSet
has been moved to thestitch
package.Operation
type has been removed in favor ofOperationTypeNode
from upstream graphql-js.applySchemaTransforms
/applyRequestTransforms
/applyResultTransforms
have been removed from theutils
package, as they are implemented elsewhere or no longer necessary.Related Issues
Patch Changes
@graphql-tools/mock@7.0.0
Major Changes
be1a157: ## Breaking Changes:
Schema Generation and Decoration API (
@graphql-tools/schema
)Resolver validation options should now be set to
error
,warn
orignore
rather thantrue
orfalse
. 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 torequireResolversToMatchSchema
, to harmonize the naming convention of all the validators. The default setting ofrequireResolversToMatchSchema
iserror
, matching the previous behavior.Schema Delegation (
delegateToSchema
&@graphql-tools/delegate
)The
delegateToSchema
return value has matured and been formalized as anExternalObject
, 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 includingslicedError
,getErrors
,getErrorsByPathSegment
functions. Only external errors with missing or invalid paths must still be preserved by annotating the remote object with special properties. The newgetUnpathedErrors
function is therefore necessary for retrieving only these errors. Note also the newannotateExternalObject
andmergeExternalObjects
functions, as well as the renaming ofhandleResult
toresolveExternalValue
.Transform types and the
applySchemaTransforms
are now relocated to thedelegate
package;applyRequestTransforms
/applyResultTransforms
functions have been deprecated, however, as this functionality has been replaced since v6 by theTransformer
abstraction.The
transformRequest
/transformResult
methods are now provided additionaldelegationContext
andtransformationContext
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 thesubschemaConfig
and final (non-executable)transformedSchema
parameters. As in v6, thetransformSchema
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 individualtransformSchema
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 thetransformSchema
parameters above.Remote Schemas & Wrapping (
wrapSchema
,makeRemoteExecutableSchema
, and@graphql-tools/wrap
)wrapSchema
andgenerateProxyingResolvers
now only take a single options argument with named properties of typeSubschemaConfig
. The previously possible shorthand version with first argument consisting of aGraphQLSchema
and second argument representing the transforms should be reworked as aSubschemaConfig
object.Similarly, the
ICreateProxyingResolverOptions
interface that provides the options for thecreateProxyingResolver
property ofSubschemaConfig
options has been adjusted. Theschema
property previously could be set to aGraphQLSchema
or aSubschemaConfig
object. This property has been removed in favor of asubschemaConfig
property that will always be aSubschemaConfig
object. Thetransforms
property has been removed; transforms should be included within theSubschemaConfig
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 throughtcreateMergedResolver
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'swrappingResolver
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 asTransformRootFields
orTransformObjectFields
.The
ExtendSchema
transform has been removed, as it is conceptually simpler just to usestitchSchemas
with one subschema.The
ReplaceFieldsWithFragment
,AddFragmentsByField
,AddSelectionSetsByField
, andAddMergedTypeSelectionSets
transforms has been removed, as they are superseded by theAddSelectionSets
andVisitSelectionSets
transforms. TheAddSelectionSets
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 theparseSelectionSet
function from@graphql-tools/utils
.Schema Stitching (
stitchSchemas
&@graphql-tools/stitch
)stitchSchemas
'smergeTypes
option is now true by default! This causes theonTypeConflict
option to be ignored by default. To useonTypeConflict
to select a specific type instead of simply merging, simply setmergeTypes
to false.schemas
argument has been deprecated, usesubschemas
,typeDefs
, ortypes
, depending on what you are stitching.When using batch delegation in type merging, the
argsFromKeys
function is now set only via theargsFromKeys
property. Previously, ifargsFromKeys
was absent, it could be read fromargs
.Support for fragment hints has been removed in favor of selection set hints.
stitchSchemas
now processes allGraphQLSchema
andSubschemaConfig
subschema input into newSubschema
objects, handling schema config directives such aso@computed
as well as generating the final transformed schema, stored as thetransformedSchema
property, if transforms are used. Signatures of theonTypeConflict
,fieldConfigMerger
, andinputFieldConfigMerger
have been updated to include metadata related to the original and transformed subschemas. Note the property name change foronTypeConflict
fromschema
tosubschema
.Mocking (
addMocksToSchema
and@graphql-tools/mock
)args
,context
, andinfo
withparent
available asthis
rather than as the first argument.Other Utilities (
@graphql-tools/utils
)filterSchema
'sfieldFilter
will now filter all fields across Object, Interface, and Input types. For the previous Object-only behavior, switch to theobjectFieldFilter
option.fieldNodes
utility functions have been removed.typeContainsSelectionSet
function has been removed, andtypesContainSelectionSet
has been moved to thestitch
package.Operation
type has been removed in favor ofOperationTypeNode
from upstream graphql-js.applySchemaTransforms
/applyRequestTransforms
/applyResultTransforms
have been removed from theutils
package, as they are implemented elsewhere or no longer necessary.Related Issues
Patch Changes
@graphql-tools/schema@7.0.0
Major Changes
be1a157: ## Breaking Changes:
Schema Generation and Decoration API (
@graphql-tools/schema
)Resolver validation options should now be set to
error
,warn
orignore
rather thantrue
orfalse
. 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 torequireResolversToMatchSchema
, to harmonize the naming convention of all the validators. The default setting ofrequireResolversToMatchSchema
iserror
, matching the previous behavior.Schema Delegation (
delegateToSchema
&@graphql-tools/delegate
)The
delegateToSchema
return value has matured and been formalized as anExternalObject
, 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 includingslicedError
,getErrors
,getErrorsByPathSegment
functions. Only external errors with missing or invalid paths must still be preserved by annotating the remote object with special properties. The newgetUnpathedErrors
function is therefore necessary for retrieving only these errors. Note also the newannotateExternalObject
andmergeExternalObjects
functions, as well as the renaming ofhandleResult
toresolveExternalValue
.Transform types and the
applySchemaTransforms
are now relocated to thedelegate
package;applyRequestTransforms
/applyResultTransforms
functions have been deprecated, however, as this functionality has been replaced since v6 by theTransformer
abstraction.The
transformRequest
/transformResult
methods are now provided additionaldelegationContext
andtransformationContext
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 thesubschemaConfig
and final (non-executable)transformedSchema
parameters. As in v6, thetransformSchema
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 individualtransformSchema
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 thetransformSchema
parameters above.Remote Schemas & Wrapping (
wrapSchema
,makeRemoteExecutableSchema
, and@graphql-tools/wrap
)wrapSchema
andgenerateProxyingResolvers
now only take a single options argument with named properties of typeSubschemaConfig
. The previously possible shorthand version with first argument consisting of aGraphQLSchema
and second argument representing the transforms should be reworked as aSubschemaConfig
object.Similarly, the
ICreateProxyingResolverOptions
interface that provides the options for thecreateProxyingResolver
property ofSubschemaConfig
options has been adjusted. Theschema
property previously could be set to aGraphQLSchema
or aSubschemaConfig
object. This property has been removed in favor of asubschemaConfig
property that will always be aSubschemaConfig
object. Thetransforms
property has been removed; transforms should be included within theSubschemaConfig
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 throughtcreateMergedResolver
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'swrappingResolver
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 asTransformRootFields
orTransformObjectFields
.The
ExtendSchema
transform has been removed, as it is conceptually simpler just to usestitchSchemas
with one subschema.The
ReplaceFieldsWithFragment
,AddFragmentsByField
,AddSelectionSetsByField
, andAddMergedTypeSelectionSets
transforms has been removed, as they are superseded by theAddSelectionSets
andVisitSelectionSets
transforms. TheAddSelectionSets
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 theparseSelectionSet
function from@graphql-tools/utils
.Schema Stitching (
stitchSchemas
&@graphql-tools/stitch
)stitchSchemas
'smergeTypes
option is now true by default! This causes theonTypeConflict
option to be ignored by default. To useonTypeConflict
to select a specific type instead of simply merging, simply setmergeTypes
to false.schemas
argument has been deprecated, usesubschemas
,typeDefs
, ortypes
, depending on what you are stitching.When using batch delegation in type merging, the
argsFromKeys
function is now set only via theargsFromKeys
property. Previously, ifargsFromKeys
was absent, it could be read fromargs
.Support for fragment hints has been removed in favor of selection set hints.
stitchSchemas
now processes allGraphQLSchema
andSubschemaConfig
subschema input into newSubschema
objects, handling schema config directives such aso@computed
as well as generating the final transformed schema, stored as thetransformedSchema
property, if transforms are used. Signatures of theonTypeConflict
,fieldConfigMerger
, andinputFieldConfigMerger
have been updated to include metadata related to the original and transformed subschemas. Note the property name change foronTypeConflict
fromschema
tosubschema
.Mocking (
addMocksToSchema
and@graphql-tools/mock
)args
,context
, andinfo
withparent
available asthis
rather than as the first argument.Other Utilities (
@graphql-tools/utils
)filterSchema
'sfieldFilter
will now filter all fields across Object, Interface, and Input types. For the previous Object-only behavior, switch to theobjectFieldFilter
option.fieldNodes
utility functions have been removed.typeContainsSelectionSet
function has been removed, andtypesContainSelectionSet
has been moved to thestitch
package.Operation
type has been removed in favor ofOperationTypeNode
from upstream graphql-js.applySchemaTransforms
/applyRequestTransforms
/applyResultTransforms
have been removed from theutils
package, as they are implemented elsewhere or no longer necessary.Related Issues
Patch Changes
@graphql-tools/stitch@7.0.0
Major Changes
be1a157: ## Breaking Changes:
Schema Generation and Decoration API (
@graphql-tools/schema
)Resolver validation options should now be set to
error
,warn
orignore
rather thantrue
orfalse
. 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 torequireResolversToMatchSchema
, to harmonize the naming convention of all the validators. The default setting ofrequireResolversToMatchSchema
iserror
, matching the previous behavior.Schema Delegation (
delegateToSchema
&@graphql-tools/delegate
)The
delegateToSchema
return value has matured and been formalized as anExternalObject
, 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 includingslicedError
,getErrors
,getErrorsByPathSegment
functions. Only external errors with missing or invalid paths must still be preserved by annotating the remote object with special properties. The newgetUnpathedErrors
function is therefore necessary for retrieving only these errors. Note also the newannotateExternalObject
andmergeExternalObjects
functions, as well as the renaming ofhandleResult
toresolveExternalValue
.Transform types and the
applySchemaTransforms
are now relocated to thedelegate
package;applyRequestTransforms
/applyResultTransforms
functions have been deprecated, however, as this functionality has been replaced since v6 by theTransformer
abstraction.The
transformRequest
/transformResult
methods are now provided additionaldelegationContext
andtransformationContext
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 thesubschemaConfig
and final (non-executable)transformedSchema
parameters. As in v6, thetransformSchema
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 individualtransformSchema
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 thetransformSchema
parameters above.Remote Schemas & Wrapping (
wrapSchema
,makeRemoteExecutableSchema
, and@graphql-tools/wrap
)wrapSchema
andgenerateProxyingResolvers
now only take a single options argument with named properties of typeSubschemaConfig
. The previously possible shorthand version with first argument consisting of aGraphQLSchema
and second argument representing the transforms should be reworked as aSubschemaConfig
object.Similarly, the
ICreateProxyingResolverOptions
interface that provides the options for thecreateProxyingResolver
property ofSubschemaConfig
options has been adjusted. Theschema
property previously could be set to aGraphQLSchema
or aSubschemaConfig
object. This property has been removed in favor of asubschemaConfig
property that will always be aSubschemaConfig
object. Thetransforms
property has been removed; transforms should be included within theSubschemaConfig
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 throughtcreateMergedResolver
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'swrappingResolver
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 asTransformRootFields
orTransformObjectFields
.The
ExtendSchema
transform has been removed, as it is conceptually simpler just to usestitchSchemas
with one subschema.The
ReplaceFieldsWithFragment
,AddFragmentsByField
,AddSelectionSetsByField
, andAddMergedTypeSelectionSets
transforms has been removed, as they are superseded by theAddSelectionSets
andVisitSelectionSets
transforms. TheAddSelectionSets
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 theparseSelectionSet
function from@graphql-tools/utils
.Schema Stitching (
stitchSchemas
&@graphql-tools/stitch
)stitchSchemas
'smergeTypes
option is now true by default! This causes theonTypeConflict
option to be ignored by default. To useonTypeConflict
to select a specific type instead of simply merging, simply setmergeTypes
to false.schemas
argument has been deprecated, usesubschemas
,typeDefs
, ortypes
, depending on what you are stitching.When using batch delegation in type merging, the
argsFromKeys
function is now set only via theargsFromKeys
property. Previously, ifargsFromKeys
was absent, it could be read fromargs
.Support for fragment hints has been removed in favor of selection set hints.
stitchSchemas
now processes allGraphQLSchema
andSubschemaConfig
subschema input into newSubschema
objects, handling schema config directives such aso@computed
as well as generating the final transformed schema, stored as thetransformedSchema
property, if transforms are used. Signatures of theonTypeConflict
,fieldConfigMerger
, andinputFieldConfigMerger
have been updated to include metadata related to the original and transformed subschemas. Note the property name change foronTypeConflict
fromschema
tosubschema
.Mocking (
addMocksToSchema
and@graphql-tools/mock
)args
,context
, andinfo
withparent
available asthis
rather than as the first argument.Other Utilities (
@graphql-tools/utils
)filterSchema
'sfieldFilter
will now filter all fields across Object, Interface, and Input types. For the previous Object-only behavior, switch to theobjectFieldFilter
option.fieldNodes
utility functions have been removed.typeContainsSelectionSet
function has been removed, andtypesContainSelectionSet
has been moved to thestitch
package.Operation
type has been removed in favor ofOperationTypeNode
from upstream graphql-js.applySchemaTransforms
/applyRequestTransforms
/applyResultTransforms
have been removed from theutils
package, as they are implemented elsewhere or no longer necessary.Related Issues
Patch Changes
@graphql-tools/utils@7.0.0
Major Changes
be1a157: ## Breaking Changes:
Schema Generation and Decoration API (
@graphql-tools/schema
)Resolver validation options should now be set to
error
,warn
orignore
rather thantrue
orfalse
. 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 torequireResolversToMatchSchema
, to harmonize the naming convention of all the validators. The default setting ofrequireResolversToMatchSchema
iserror
, matching the previous behavior.Schema Delegation (
delegateToSchema
&@graphql-tools/delegate
)The
delegateToSchema
return value has matured and been formalized as anExternalObject
, 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 includingslicedError
,getErrors
,getErrorsByPathSegment
functions. Only external errors with missing or invalid paths must still be preserved by annotating the remote object with special properties. The newgetUnpathedErrors
function is therefore necessary for retrieving only these errors. Note also the newannotateExternalObject
andmergeExternalObjects
functions, as well as the renaming ofhandleResult
toresolveExternalValue
.Transform types and the
applySchemaTransforms
are now relocated to thedelegate
package;applyRequestTransforms
/applyResultTransforms
functions have been deprecated, however, as this functionality has been replaced since v6 by theTransformer
abstraction.The
transformRequest
/transformResult
methods are now provided additionaldelegationContext
andtransformationContext
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 thesubschemaConfig
and final (non-executable)transformedSchema
parameters. As in v6, thetransformSchema
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 individualtransformSchema
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 thetransformSchema
parameters above.Remote Schemas & Wrapping (
wrapSchema
,makeRemoteExecutableSchema
, and@graphql-tools/wrap
)wrapSchema
andgenerateProxyingResolvers
now only take a single options argument with named properties of typeSubschemaConfig
. The previously possible shorthand version with first argument consisting of aGraphQLSchema
and second argument representing the transforms should be reworked as aSubschemaConfig
object.Similarly, the
ICreateProxyingResolverOptions
interface that provides the options for thecreateProxyingResolver
property ofSubschemaConfig
options has been adjusted. Theschema
property previously could be set to aGraphQLSchema
or aSubschemaConfig
object. This property has been removed in favor of asubschemaConfig
property that will always be aSubschemaConfig
object. Thetransforms
property has been removed; transforms should be included within theSubschemaConfig
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 throughtcreateMergedResolver
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'swrappingResolver
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 asTransformRootFields
orTransformObjectFields
.The
ExtendSchema
transform has been removed, as it is conceptually simpler just to usestitchSchemas
with one subschema.The
ReplaceFieldsWithFragment
,AddFragmentsByField
,AddSelectionSetsByField
, andAddMergedTypeSelectionSets
transforms has been removed, as they are superseded by theAddSelectionSets
andVisitSelectionSets
transforms. TheAddSelectionSets
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 theparseSelectionSet
function from@graphql-tools/utils
.Schema Stitching (
stitchSchemas
&@graphql-tools/stitch
)stitchSchemas
'smergeTypes
option is now true by default! This causes theonTypeConflict
option to be ignored by default. To useonTypeConflict
to select a specific type instead of simply merging, simply setmergeTypes
to false.schemas
argument has been deprecated, usesubschemas
,typeDefs
, ortypes
, depending on what you are stitching.When using batch delegation in type merging, the
argsFromKeys
function is now set only via theargsFromKeys
property. Previously, ifargsFromKeys
was absent, it could be read fromargs
.Support for fragment hints has been removed in favor of selection set hints.
stitchSchemas
now processes allGraphQLSchema
andSubschemaConfig
subschema input into newSubschema
objects, handling schema config directives such aso@computed
as well as generating the final transformed schema, stored as thetransformedSchema
property, if transforms are used. Signatures of theonTypeConflict
,fieldConfigMerger
, andinputFieldConfigMerger
have been updated to include metadata related to the original and transformed subschemas. Note the property name change foronTypeConflict
fromschema
tosubschema
.Mocking (
addMocksToSchema
and@graphql-tools/mock
)args
,context
, andinfo
withparent
available asthis
rather than as the first argument.Other Utilities (
@graphql-tools/utils
)filterSchema
'sfieldFilter
will now filter all fields across Object, Interface, and Input types. For the previous Object-only behavior, switch to theobjectFieldFilter
option.fieldNodes
utility functions have been removed.typeContainsSelectionSet
function has been removed, andtypesContainSelectionSet
has been moved to thestitch
package.Operation
type has been removed in favor ofOperationTypeNode
from upstream graphql-js.applySchemaTransforms
/applyRequestTransforms
/applyResultTransforms
have been removed from theutils
package, as they are implemented elsewhere or no longer necessary.Related Issues
@graphql-tools/wrap@7.0.0
Major Changes
be1a157: ## Breaking Changes:
Schema Generation and Decoration API (
@graphql-tools/schema
)Resolver validation options should now be set to
error
,warn
orignore
rather thantrue
orfalse
. 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 torequireResolversToMatchSchema
, to harmonize the naming convention of all the validators. The default setting ofrequireResolversToMatchSchema
iserror
, matching the previous behavior.Schema Delegation (
delegateToSchema
&@graphql-tools/delegate
)The
delegateToSchema
return value has matured and been formalized as anExternalObject
, 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 includingslicedError
,getErrors
,getErrorsByPathSegment
functions. Only external errors with missing or invalid paths must still be preserved by annotating the remote object with special properties. The newgetUnpathedErrors
function is therefore necessary for retrieving only these errors. Note also the newannotateExternalObject
andmergeExternalObjects
functions, as well as the renaming ofhandleResult
toresolveExternalValue
.Transform types and the
applySchemaTransforms
are now relocated to thedelegate
package;applyRequestTransforms
/applyResultTransforms
functions have been deprecated, however, as this functionality has been replaced since v6 by theTransformer
abstraction.The
transformRequest
/transformResult
methods are now provided additionaldelegationContext
andtransformationContext
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 thesubschemaConfig
and final (non-executable)transformedSchema
parameters. As in v6, thetransformSchema
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 individualtransformSchema
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 thetransformSchema
parameters above.Remote Schemas & Wrapping (
wrapSchema
,makeRemoteExecutableSchema
, and@graphql-tools/wrap
)wrapSchema
andgenerateProxyingResolvers
now only take a single options argument with named properties of typeSubschemaConfig
. The previously possible shorthand version with first argument consisting of aGraphQLSchema
and second argument representing the transforms should be reworked as aSubschemaConfig
object.Similarly, the
ICreateProxyingResolverOptions
interface that provides the options for thecreateProxyingResolver
property ofSubschemaConfig
options has been adjusted. Theschema
property previously could be set to aGraphQLSchema
or aSubschemaConfig
object. This property has been removed in favor of asubschemaConfig
property that will always be aSubschemaConfig
object. Thetransforms
property has been removed; transforms should be included within theSubschemaConfig
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 throughtcreateMergedResolver
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'swrappingResolver
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 asTransformRootFields
orTransformObjectFields
.The
ExtendSchema
transform has been removed, as it is conceptually simpler just to usestitchSchemas
with one subschema.The
ReplaceFieldsWithFragment
,AddFragmentsByField
,AddSelectionSetsByField
, andAddMergedTypeSelectionSets
transforms has been removed, as they are superseded by theAddSelectionSets
andVisitSelectionSets
transforms. TheAddSelectionSets
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 theparseSelectionSet
function from@graphql-tools/utils
.Schema Stitching (
stitchSchemas
&@graphql-tools/stitch
)stitchSchemas
'smergeTypes
option is now true by default! This causes theonTypeConflict
option to be ignored by default. To useonTypeConflict
to select a specific type instead of simply merging, simply setmergeTypes
to false.schemas
argument has been deprecated, usesubschemas
,typeDefs
, ortypes
, depending on what you are stitching.When using batch delegation in type merging, the
argsFromKeys
function is now set only via theargsFromKeys
property. Previously, ifargsFromKeys
was absent, it could be read fromargs
.Support for fragment hints has been removed in favor of selection set hints.
stitchSchemas
now processes allGraphQLSchema
andSubschemaConfig
subschema input into newSubschema
objects, handling schema config directives such aso@computed
as well as generating the final transformed schema, stored as thetransformedSchema
property, if transforms are used. Signatures of theonTypeConflict
,fieldConfigMerger
, andinputFieldConfigMerger
have been updated to include metadata related to the original and transformed subschemas. Note the property name change foronTypeConflict
fromschema
tosubschema
.Mocking (
addMocksToSchema
and@graphql-tools/mock
)args
,context
, andinfo
withparent
available asthis
rather than as the first argument.Other Utilities (
@graphql-tools/utils
)filterSchema
'sfieldFilter
will now filter all fields across Object, Interface, and Input types. For the previous Object-only behavior, switch to theobjectFieldFilter
option.fieldNodes
utility functions have been removed.typeContainsSelectionSet
function has been removed, andtypesContainSelectionSet
has been moved to thestitch
package.Operation
type has been removed in favor ofOperationTypeNode
from upstream graphql-js.applySchemaTransforms
/applyRequestTransforms
/applyResultTransforms
have been removed from theutils
package, as they are implemented elsewhere or no longer necessary.Related Issues
Patch Changes
@graphql-tools/batch-delegate@6.2.5
Patch Changes
@graphql-tools/graphql-tag-pluck@6.2.6
Patch Changes
graphql-tools@6.2.5
Patch Changes
@graphql-tools/links@6.2.5
Patch Changes
be1a157: ## Breaking Changes:
Schema Generation and Decoration API (
@graphql-tools/schema
)Resolver validation options should now be set to
error
,warn
orignore
rather thantrue
orfalse
. 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 torequireResolversToMatchSchema
, to harmonize the naming convention of all the validators. The default setting ofrequireResolversToMatchSchema
iserror
, matching the previous behavior.Schema Delegation (
delegateToSchema
&@graphql-tools/delegate
)The
delegateToSchema
return value has matured and been formalized as anExternalObject
, 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 includingslicedError
,getErrors
,getErrorsByPathSegment
functions. Only external errors with missing or invalid paths must still be preserved by annotating the remote object with special properties. The newgetUnpathedErrors
function is therefore necessary for retrieving only these errors. Note also the newannotateExternalObject
andmergeExternalObjects
functions, as well as the renaming ofhandleResult
toresolveExternalValue
.Transform types and the
applySchemaTransforms
are now relocated to thedelegate
package;applyRequestTransforms
/applyResultTransforms
functions have been deprecated, however, as this functionality has been replaced since v6 by theTransformer
abstraction.The
transformRequest
/transformResult
methods are now provided additionaldelegationContext
andtransformationContext
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 thesubschemaConfig
and final (non-executable)transformedSchema
parameters. As in v6, thetransformSchema
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 individualtransformSchema
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 thetransformSchema
parameters above.Remote Schemas & Wrapping (
wrapSchema
,makeRemoteExecutableSchema
, and@graphql-tools/wrap
)wrapSchema
andgenerateProxyingResolvers
now only take a single options argument with named properties of typeSubschemaConfig
. The previously possible shorthand version with first argument consisting of aGraphQLSchema
and second argument representing the transforms should be reworked as aSubschemaConfig
object.Similarly, the
ICreateProxyingResolverOptions
interface that provides the options for thecreateProxyingResolver
property ofSubschemaConfig
options has been adjusted. Theschema
property previously could be set to aGraphQLSchema
or aSubschemaConfig
object. This property has been removed in favor of asubschemaConfig
property that will always be aSubschemaConfig
object. Thetransforms
property has been removed; transforms should be included within theSubschemaConfig
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 throughtcreateMergedResolver
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'swrappingResolver
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 asTransformRootFields
orTransformObjectFields
.The
ExtendSchema
transform has been removed, as it is conceptually simpler just to usestitchSchemas
with one subschema.The
ReplaceFieldsWithFragment
,AddFragmentsByField
,AddSelectionSetsByField
, andAddMergedTypeSelectionSets
transforms has been removed, as they are superseded by theAddSelectionSets
andVisitSelectionSets
transforms. TheAddSelectionSets
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 theparseSelectionSet
function from@graphql-tools/utils
.Schema Stitching (
stitchSchemas
&@graphql-tools/stitch
)stitchSchemas
'smergeTypes
option is now true by default! This causes theonTypeConflict
option to be ignored by default. To useonTypeConflict
to select a specific type instead of simply merging, simply setmergeTypes
to false.schemas
argument has been deprecated, usesubschemas
,typeDefs
, ortypes
, depending on what you are stitching.When using batch delegation in type merging, the
argsFromKeys
function is now set only via theargsFromKeys
property. Previously, ifargsFromKeys
was absent, it could be read fromargs
.Support for fragment hints has been removed in favor of selection set hints.
stitchSchemas
now processes allGraphQLSchema
andSubschemaConfig
subschema input into newSubschema
objects, handling schema config directives such aso@computed
as well as generating the final transformed schema, stored as thetransformedSchema
property, if transforms are used. Signatures of theonTypeConflict
,fieldConfigMerger
, andinputFieldConfigMerger
have been updated to include metadata related to the original and transformed subschemas. Note the property name change foronTypeConflict
fromschema
tosubschema
.Mocking (
addMocksToSchema
and@graphql-tools/mock
)args
,context
, andinfo
withparent
available asthis
rather than as the first argument.Other Utilities (
@graphql-tools/utils
)filterSchema
'sfieldFilter
will now filter all fields across Object, Interface, and Input types. For the previous Object-only behavior, switch to theobjectFieldFilter
option.fieldNodes
utility functions have been removed.typeContainsSelectionSet
function has been removed, andtypesContainSelectionSet
has been moved to thestitch
package.Operation
type has been removed in favor ofOperationTypeNode
from upstream graphql-js.applySchemaTransforms
/applyRequestTransforms
/applyResultTransforms
have been removed from theutils
package, as they are implemented elsewhere or no longer necessary.Related Issues
Updated dependencies [be1a157]
@graphql-tools/load@6.2.5
Patch Changes
@graphql-tools/apollo-engine-loader@6.2.5
Patch Changes
@graphql-tools/code-file-loader@6.2.5
Patch Changes
@graphql-tools/git-loader@6.2.5
Patch Changes
@graphql-tools/github-loader@6.2.5
Patch Changes
@graphql-tools/graphql-file-loader@6.2.5
Patch Changes
@graphql-tools/json-file-loader@6.2.5
Patch Changes
@graphql-tools/module-loader@6.2.5
Patch Changes
@graphql-tools/prisma-loader@6.2.5
Patch Changes
@graphql-tools/url-loader@6.3.1
Patch Changes
@graphql-tools/merge@6.2.5
Patch Changes
be1a157: ## Breaking Changes:
Schema Generation and Decoration API (
@graphql-tools/schema
)Resolver validation options should now be set to
error
,warn
orignore
rather thantrue
orfalse
. 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 torequireResolversToMatchSchema
, to harmonize the naming convention of all the validators. The default setting ofrequireResolversToMatchSchema
iserror
, matching the previous behavior.Schema Delegation (
delegateToSchema
&@graphql-tools/delegate
)The
delegateToSchema
return value has matured and been formalized as anExternalObject
, 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 includingslicedError
,getErrors
,getErrorsByPathSegment
functions. Only external errors with missing or invalid paths must still be preserved by annotating the remote object with special properties. The newgetUnpathedErrors
function is therefore necessary for retrieving only these errors. Note also the newannotateExternalObject
andmergeExternalObjects
functions, as well as the renaming ofhandleResult
toresolveExternalValue
.Transform types and the
applySchemaTransforms
are now relocated to thedelegate
package;applyRequestTransforms
/applyResultTransforms
functions have been deprecated, however, as this functionality has been replaced since v6 by theTransformer
abstraction.The
transformRequest
/transformResult
methods are now provided additionaldelegationContext
andtransformationContext
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 thesubschemaConfig
and final (non-executable)transformedSchema
parameters. As in v6, thetransformSchema
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 individualtransformSchema
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 thetransformSchema
parameters above.Remote Schemas & Wrapping (
wrapSchema
,makeRemoteExecutableSchema
, and@graphql-tools/wrap
)wrapSchema
andgenerateProxyingResolvers
now only take a single options argument with named properties of typeSubschemaConfig
. The previously possible shorthand version with first argument consisting of aGraphQLSchema
and second argument representing the transforms should be reworked as aSubschemaConfig
object.Similarly, the
ICreateProxyingResolverOptions
interface that provides the options for thecreateProxyingResolver
property ofSubschemaConfig
options has been adjusted. Theschema
property previously could be set to aGraphQLSchema
or aSubschemaConfig
object. This property has been removed in favor of asubschemaConfig
property that will always be aSubschemaConfig
object. Thetransforms
property has been removed; transforms should be included within theSubschemaConfig
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 throughtcreateMergedResolver
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'swrappingResolver
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 asTransformRootFields
orTransformObjectFields
.The
ExtendSchema
transform has been removed, as it is conceptually simpler just to usestitchSchemas
with one subschema.The
ReplaceFieldsWithFragment
,AddFragmentsByField
,AddSelectionSetsByField
, andAddMergedTypeSelectionSets
transforms has been removed, as they are superseded by theAddSelectionSets
andVisitSelectionSets
transforms. TheAddSelectionSets
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 theparseSelectionSet
function from@graphql-tools/utils
.Schema Stitching (
stitchSchemas
&@graphql-tools/stitch
)stitchSchemas
'smergeTypes
option is now true by default! This causes theonTypeConflict
option to be ignored by default. To useonTypeConflict
to select a specific type instead of simply merging, simply setmergeTypes
to false.schemas
argument has been deprecated, usesubschemas
,typeDefs
, ortypes
, depending on what you are stitching.When using batch delegation in type merging, the
argsFromKeys
function is now set only via theargsFromKeys
property. Previously, ifargsFromKeys
was absent, it could be read fromargs
.Support for fragment hints has been removed in favor of selection set hints.
stitchSchemas
now processes allGraphQLSchema
andSubschemaConfig
subschema input into newSubschema
objects, handling schema config directives such aso@computed
as well as generating the final transformed schema, stored as thetransformedSchema
property, if transforms are used. Signatures of theonTypeConflict
,fieldConfigMerger
, andinputFieldConfigMerger
have been updated to include metadata related to the original and transformed subschemas. Note the property name change foronTypeConflict
fromschema
tosubschema
.Mocking (
addMocksToSchema
and@graphql-tools/mock
)args
,context
, andinfo
withparent
available asthis
rather than as the first argument.Other Utilities (
@graphql-tools/utils
)filterSchema
'sfieldFilter
will now filter all fields across Object, Interface, and Input types. For the previous Object-only behavior, switch to theobjectFieldFilter
option.fieldNodes
utility functions have been removed.typeContainsSelectionSet
function has been removed, andtypesContainSelectionSet
has been moved to thestitch
package.Operation
type has been removed in favor ofOperationTypeNode
from upstream graphql-js.applySchemaTransforms
/applyRequestTransforms
/applyResultTransforms
have been removed from theutils
package, as they are implemented elsewhere or no longer necessary.Related Issues
Updated dependencies [be1a157]
@graphql-tools/relay-operation-optimizer@6.2.5
Patch Changes
@graphql-tools/resolvers-composition@6.2.5
Patch Changes