@graphql-tools/schema
10.0.16
Patch Changes
10.0.15
Patch Changes
- Updated dependencies
[
4912f19
]:- @graphql-tools/utils@10.7.1
- @graphql-tools/merge@9.0.16
10.0.14
Patch Changes
- Updated dependencies
[
2c70d27
]:- @graphql-tools/utils@10.7.0
- @graphql-tools/merge@9.0.15
10.0.13
Patch Changes
- Updated dependencies
[
6a8123b
]:- @graphql-tools/utils@10.6.4
- @graphql-tools/merge@9.0.14
10.0.12
Patch Changes
-
020b9e4
Thanks @ardatan ! - `AbortSignal` in `GraphQLResolveInfo`, and `AbortSignal` in `ExecutionRequest` -
Updated dependencies [
020b9e4
]:- @graphql-tools/utils@10.6.3
- @graphql-tools/merge@9.0.13
10.0.11
Patch Changes
- #6662
696a0d5
Thanks @renovate ! - dependencies updates:- Updated dependency
@graphql-tools/merge@^9.0.11
↗︎ (from^9.0.10
, independencies
) - Updated dependency
@graphql-tools/utils@^10.6.1
↗︎ (from^10.6.0
, independencies
)
- Updated dependency
- Updated dependencies
[
696a0d5
,1b24656
]:- @graphql-tools/merge@9.0.12
- @graphql-tools/utils@10.6.2
10.0.10
Patch Changes
- Updated dependencies
[
1e02935
]:- @graphql-tools/utils@10.6.1
- @graphql-tools/merge@9.0.11
10.0.9
Patch Changes
- Updated dependencies
[
414e404
]:- @graphql-tools/utils@10.6.0
- @graphql-tools/merge@9.0.10
10.0.8
Patch Changes
- Updated dependencies
[
dc5043b
]:- @graphql-tools/utils@10.5.6
- @graphql-tools/merge@9.0.9
10.0.7
Patch Changes
- Updated dependencies
[
cf2ce5e
]:- @graphql-tools/utils@10.5.5
- @graphql-tools/merge@9.0.8
10.0.6
Patch Changes
-
Updated dependencies [
0286437
]:- @graphql-tools/merge@9.0.6
- @graphql-tools/utils@10.5.4
10.0.5
Patch Changes
-
b8bf584
Thanks @ardatan ! - Introduce `getDirectiveExtensions` and refactor directive handling in the extensions -
Updated dependencies [
b8bf584
]:- @graphql-tools/utils@10.4.0
- @graphql-tools/merge@9.0.5
10.0.4
Patch Changes
-
#6194
7368829
Thanks @ardatan ! - Handle interface objects in a different way -
Updated dependencies [
7368829
,e10c13a
]:- @graphql-tools/utils@10.2.1
10.0.3
Patch Changes
- #5913
83c0af0
Thanks @enisdenjo ! - dependencies updates:- Updated dependency
@graphql-tools/utils@^10.0.13
↗︎ (from^10.0.10
, independencies
)
- Updated dependency
- Updated dependencies
[
83c0af0
]:- @graphql-tools/merge@9.0.3
10.0.2
Patch Changes
-
a570a601
Thanks @ardatan ! - Add respectArrays flag to extensions merging -
Updated dependencies [
a570a601
]:- @graphql-tools/merge@9.0.1
- @graphql-tools/utils@10.0.10
10.0.1
Patch Changes
-
e1fb8bb8
Thanks @ardatan ! - Merge directives in the extensions -
Updated dependencies [
e1fb8bb8
]:- @graphql-tools/utils@10.0.9
10.0.0
Major Changes
Patch Changes
9.0.19
Patch Changes
- #5202
05c97eb8
Thanks @ardatan ! - dependencies updates:- Updated dependency
value-or-promise@^1.0.12
↗︎ (from1.0.12
, independencies
)
- Updated dependency
9.0.18
Patch Changes
-
1c95368a
Thanks @ardatan ! - Use ranged versions for dependencies -
Updated dependencies [
1c95368a
]:- @graphql-tools/merge@8.4.1
9.0.17
Patch Changes
- Updated dependencies
[
04e3ecb9
]:- @graphql-tools/merge@8.4.0
9.0.16
Patch Changes
- Updated dependencies
[
b5c8f640
]:- @graphql-tools/utils@9.2.1
- @graphql-tools/merge@8.3.18
9.0.15
Patch Changes
9.0.14
Patch Changes
- Updated dependencies
[
8555c5c5
]:- @graphql-tools/merge@8.3.16
9.0.13
Patch Changes
- #4943
a4d36fcc
Thanks @renovate ! - dependencies updates:- Updated dependency
value-or-promise@1.0.12
↗︎ (from1.0.11
, independencies
)
- Updated dependency
- Updated dependencies
[
e3ec35ed
]:- @graphql-tools/utils@9.1.4
- @graphql-tools/merge@8.3.15
9.0.12
Patch Changes
- Updated dependencies
[
904fe770
]:- @graphql-tools/utils@9.1.3
- @graphql-tools/merge@8.3.14
9.0.11
Patch Changes
- Updated dependencies
[
13c24883
]:- @graphql-tools/utils@9.1.2
- @graphql-tools/merge@8.3.13
9.0.10
Patch Changes
- Updated dependencies
[
7411a5e7
]:- @graphql-tools/utils@9.1.1
- @graphql-tools/merge@8.3.12
9.0.9
Patch Changes
- Updated dependencies
[
c0639dd0
]:- @graphql-tools/utils@9.1.0
- @graphql-tools/merge@8.3.11
9.0.8
Patch Changes
- Updated dependencies
[
d83b1960
]:- @graphql-tools/utils@9.0.1
- @graphql-tools/merge@8.3.10
9.0.7
Patch Changes
- Updated dependencies
[
80836fa7
,8f6d3efc
,80836fa7
,80836fa7
,80836fa7
]:- @graphql-tools/utils@9.0.0
- @graphql-tools/merge@8.3.9
9.0.6
Patch Changes
- Updated dependencies
[
f7daf777
]:- @graphql-tools/utils@8.13.1
- @graphql-tools/merge@8.3.8
9.0.5
Patch Changes
- Updated dependencies
[
df5848b8
,df5848b8
,df5848b8
]:- @graphql-tools/utils@8.13.0
- @graphql-tools/merge@8.3.7
9.0.4
Patch Changes
- Updated dependencies
[
43c736bd
]:- @graphql-tools/utils@8.12.0
- @graphql-tools/merge@8.3.6
9.0.3
Patch Changes
9.0.2
Patch Changes
- Updated dependencies
[
4fe3d9c0
]:- @graphql-tools/utils@8.10.1
- @graphql-tools/merge@8.3.4
9.0.1
Patch Changes
-
#4643
2609d71f
Thanks @ardatan ! - Revert the breaking change introduced in@graphql-tools/merge
-
Updated dependencies [
2609d71f
]:- @graphql-tools/utils@8.10.0
- @graphql-tools/merge@8.3.3
9.0.0
Major Changes
-
#4463
8cc8721f
Thanks @ardatan ! - Thanks @mattkrick and @borisno2!Breaking changes
addResolversToSchema
;If you are using the legacy parameters like below, you should update them to the new usage. Other than that, there is no functional change;
// From addResolversToSchema(schema, resolvers, resolverValidationOptions) // To addResolversToSchema({ schema, resolvers, resolverValidationOptions })
mergeSchemas
;The provided
resolver
overrides the resolvers in theschema
with the same name;The
hello
resolver in theschema
would be overridden by thehello
resolver in theresolvers
. Before it was opposite which is not expected.const schema = makeExecutableSchema({ typeDefs: ` type Query { hello: String } `, resolvers: { Query: { hello: () => 'Hello world!' } } }) mergeSchemas({ schemas: [schema], resolvers: { Query: { hello: () => 'New hello world' } } })
makeExecutableSchema
no longer takesparseOptions
and you can pass those options directly;makeExecutableSchema({ typeDefs: ``, parseOptions: { assumeValid: true } }) // After makeExecutableSchema({ typeDefs: ``, assumeValid: true })
makeExecutableSchema
no longer does pruning and it doesn’t takepruningOptions
anymore. You can usepruneSchema
from@graphql-tools/utils
if you need.extractExtensionsFromSchema
moved from@graphql-tools/merge
to@graphql-tools/schema
. AndtravelSchemaPossibleExtensions
has been dropped in favor ofmapSchema
.
Patch Changes
-
#4624
e3167edc
Thanks @n1ru4l ! - Fix CommonJS TypeScript resolution withmoduleResolution
node16
ornodenext
-
Updated dependencies [
e3167edc
]:- @graphql-tools/merge@8.3.2
- @graphql-tools/utils@8.9.1
8.5.1
Patch Changes
- Updated dependencies [2a3b45e3]
- @graphql-tools/utils@8.9.0
- @graphql-tools/merge@8.3.1
8.5.0
Minor Changes
- d76a299c: Support TypeScript module resolution.
Patch Changes
- Updated dependencies [a0abbbcd]
- Updated dependencies [d76a299c]
- @graphql-tools/utils@8.8.0
- @graphql-tools/merge@8.3.0
8.4.0
Minor Changes
-
4914970b:
mergeSchemas
was skippingdefaultFieldResolver
anddefaultMergedResolver
by default while extracting resolvers for each given schema to reduce the overhead. But this doesn’t work properly if you mix wrapped schemas and local schemas. So newincludeDefaultMergedResolver
flag is introduced ingetResolversFromSchema
to put default “proxy” resolvers in the extracted resolver map formergeSchemas
.This fixes an issue with alias issue, so nested aliased fields weren’t resolved properly because of the missing
defaultMergedResolver
in the final merged schema which should come from the wrapped schema.
Patch Changes
- Updated dependencies [4914970b]
- @graphql-tools/utils@8.7.0
- @graphql-tools/merge@8.2.15
8.3.14
Patch Changes
- 041c5ba1: Use caret range for the tslib dependency
- Updated dependencies [041c5ba1]
- @graphql-tools/merge@8.2.14
- @graphql-tools/utils@8.6.13
8.3.13
Patch Changes
- Updated dependencies [da7ad43b]
- @graphql-tools/utils@8.6.12
- @graphql-tools/merge@8.2.13
8.3.12
Patch Changes
- Updated dependencies [c0762ee3]
- @graphql-tools/utils@8.6.11
- @graphql-tools/merge@8.2.12
8.3.11
Patch Changes
- Updated dependencies [0fc510cb]
- @graphql-tools/utils@8.6.10
- @graphql-tools/merge@8.2.11
8.3.10
Patch Changes
- Updated dependencies [31a33e2b]
- @graphql-tools/utils@8.6.9
- @graphql-tools/merge@8.2.10
8.3.9
Patch Changes
- Updated dependencies [cb238877]
- @graphql-tools/utils@8.6.8
- @graphql-tools/merge@8.2.9
8.3.8
Patch Changes
- Updated dependencies [0bbb1769]
- @graphql-tools/utils@8.6.7
- @graphql-tools/merge@8.2.8
8.3.7
Patch Changes
- Updated dependencies [904c0847]
- @graphql-tools/utils@8.6.6
- @graphql-tools/merge@8.2.7
8.3.6
Patch Changes
-
722abad7: Fix
addResolversToSchema
bug where type or field processing would be aborted prematurely.In previous versions, if
requireResolversToMatchSchema
was set toignore
, although no error would be thrown for an unexpected resolver type, type processing would still be aborted early. This fix changes the behavior to correctly continue resolver type processing with the next provided type.In previous versions, if a resolver field began with double underscores, it would correctly be used for legacy behavior to directly set a type property, but field processing would be aborted early. This fix changes the behavior to correctly continue type processing with the next field.
8.3.5
Patch Changes
- Updated dependencies [be2c02d7]
- @graphql-tools/utils@8.6.5
- @graphql-tools/merge@8.2.6
8.3.4
Patch Changes
- Updated dependencies [d36d530b]
- @graphql-tools/utils@8.6.4
- @graphql-tools/merge@8.2.5
8.3.3
Patch Changes
- 0c0c6857: fix - align versions
- Updated dependencies [0c0c6857]
- @graphql-tools/merge@8.2.4
8.3.2
Patch Changes
- 18341363: feat(visitResult): ignore if field not present in visited object
- Updated dependencies [18341363]
- @graphql-tools/merge@8.2.3
- @graphql-tools/utils@8.6.2
8.3.1
Patch Changes
- 4bfb3428: enhance: use ^ for tslib dependency
- Updated dependencies [4bfb3428]
- @graphql-tools/merge@8.2.1
- @graphql-tools/utils@8.5.1
8.3.0
Minor Changes
- 149afddb: fix: getting ready for GraphQL v16
Patch Changes
- Updated dependencies [149afddb]
- @graphql-tools/merge@8.2.0
- @graphql-tools/utils@8.4.0
8.2.0
Minor Changes
- c5b0719c: feat: GraphQL v16 support
Patch Changes
- Updated dependencies [c5b0719c]
- Updated dependencies [c5b0719c]
- Updated dependencies [c5b0719c]
- Updated dependencies [c5b0719c]
- Updated dependencies [c5b0719c]
- @graphql-tools/utils@8.2.0
- @graphql-tools/merge@8.1.0
8.1.2
Patch Changes
- e50852e6: use version ranges instead of a fixed version for the graphql-tools package versions
- Updated dependencies [e50852e6]
- @graphql-tools/merge@8.0.2
8.1.1
Patch Changes
- Updated dependencies [2c807ddb]
- @graphql-tools/utils@8.1.1
- @graphql-tools/merge@8.0.1
8.1.0
Minor Changes
-
67691b78: -
schemaExtensions
option has been added tomergeSchemas
,makeExecutableSchema
andstitchSchemas
configurationsBreaking Changes;
- Move
mergeSchemas
andMergeSchemasConfig
from@graphql-tools/merge
to@graphql-tools/schema
package to prevent circular dependency between them. mergeSchemasAsync
has been removed.- Move
NamedDefinitionNode
,resetComments
,collectComment
,pushComment
andprintComment
from@graphql-tools/merge
to@graphql-tools/utils
.
- Move
Patch Changes
- Updated dependencies [b9684631]
- Updated dependencies [a5fb77a4]
- Updated dependencies [9ede806a]
- Updated dependencies [67691b78]
- @graphql-tools/utils@8.1.0
- @graphql-tools/merge@8.0.0
8.0.3
Patch Changes
- Updated dependencies [4992b472]
- @graphql-tools/merge@7.0.0
8.0.2
Patch Changes
- Updated dependencies [04830049]
- @graphql-tools/utils@8.0.2
- @graphql-tools/merge@6.2.17
8.0.1
Patch Changes
- Updated dependencies [b823dbaf]
- @graphql-tools/utils@8.0.1
- @graphql-tools/merge@6.2.16
8.0.0
Major Changes
- 7d3e3006: BREAKING CHANGE
- Legacy Schema Directives and Directive Resolvers have been removed
-
- You can check the new method for both;
- 7d3e3006: BREAKING CHANGE
- Remove
logger
andaddErrorLoggingToSchema
-
- You can implement logging and debugging mechanism outside the resolvers using some kind of plugin system based library like Envelop
- Remove
- 7d3e3006: BREAKING CHANGE
- Remove schema level resolvers feature and
addSchemaLevelResolver
-
- You can wrap your resolvers by using Resolvers Composition
- Remove schema level resolvers feature and
- 7d3e3006: BREAKING CHANGE
- No longer exports
buildSchemaFromTypeDefinitions
, usebuildSchema
fromgraphql-js
instead - Remove
allowUndefinedResolve
option inmakeExecutableSchema
because GraphQL Schema itself does this checking
- No longer exports
Patch Changes
- 7d3e3006: enhance(schema): use merge package to handle typeDefs and resolvers merging
- Updated dependencies [af9a78de]
- Updated dependencies [9c26b847]
- Updated dependencies [7d3e3006]
- Updated dependencies [7d3e3006]
- Updated dependencies [dae6dc7b]
- Updated dependencies [6877b913]
- Updated dependencies [c42e811d]
- Updated dependencies [7d3e3006]
- Updated dependencies [8c8d4fc0]
- Updated dependencies [7d3e3006]
- Updated dependencies [7d3e3006]
- Updated dependencies [74581cf3]
- Updated dependencies [c0ca3190]
- Updated dependencies [982c8f53]
- Updated dependencies [7d3e3006]
- Updated dependencies [a31f9593]
- Updated dependencies [7d3e3006]
- @graphql-tools/utils@8.0.0
- @graphql-tools/merge@6.2.15
7.1.5
Patch Changes
- 22a9f3da: fix(deps): follow package conventions on when to pin
7.1.4
Patch Changes
- 61da3e82: use value-or-promise to streamline working with sync values or async promises
7.1.3
Patch Changes
- c8e26b8c: fix(schema): ignore resolvers if they are not in schema
7.1.2
Patch Changes
- 21da6904: fix release
- Updated dependencies [21da6904]
- @graphql-tools/utils@7.1.2
7.1.1
Patch Changes
- b48a91b1: add ability to specify merge config within subschemas using directives
- Updated dependencies [b48a91b1]
- @graphql-tools/utils@7.1.1
7.1.0
Minor Changes
- 4f5a4efe: enhance(schema): add some options to improve schema creation performance
Patch Changes
- 65ed780a: enhance(schema): do not visit resolvers if no validation is selected
- b79e3a6b: enhance(schema): do not visit abstract types if requireResolversForResolveType not present
- Updated dependencies [4f5a4efe]
- @graphql-tools/utils@7.1.0
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
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-executable) 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
)- 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
, 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.- Unused
fieldNodes
utility functions have been removed. - Unused
typeContainsSelectionSet
function has been removed, andtypesContainSelectionSet
has been moved to thestitch
package. - Unnecessary
Operation
type has been removed in favor ofOperationTypeNode
from upstream graphql-js. - As above,
applySchemaTransforms
/applyRequestTransforms
/applyResultTransforms
have been removed from theutils
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
- Updated dependencies [32c3c4f8]
- Updated dependencies [533d6d53]
- @graphql-tools/utils@6.2.4