@graphql-tools/wrap
11.2.6 · 12 Nov 2026MIT15.3M / weekRepositorynpmAtom feed
204 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 8.x
8.3.2
7 Nov 2021isAsyncIterable should check if it is an object with iterator factory function
Patch Changes
isAsyncIterable should check if it is an object with iterator factory function
8.3.1
27 Oct 2021enhance: Remove isPromise and cleanup file-upload handling
enhance: Use ^ for tslib dependency
Patch Changes
enhance: Remove isPromise and cleanup file-upload handling
enhance: Use ^ for tslib dependency
8.3.0
21 Oct 2021enhance: Make operationType optional
Minor Changes
enhance: Make operationType optional
8.2.0
19 Oct 2021Getting ready for GraphQL v16
Minor Changes
Getting ready for GraphQL v16
8.1.1
21 Sep 2021wrap: Fixing variables missing on wrap/MapLeafValues transform
8.1.0
31 Aug 2021GraphQL v16 support
Minor Changes
GraphQL v16 support
8.0.13
19 Aug 2021Use version ranges instead of a fixed version for the graphql-tools package versions
Patch Changes
Use version ranges instead of a fixed version for the graphql-tools package versions
8.0.10 – 8.0.123 releases that only update dependencies@graphql-tools/utils 8.1.1@graphql-tools/delegate 8.0.10@graphql-tools/schema 8.1.1Show each
8.0.9
9 Aug 2021wrap: Handle non nullable input variables correctly
8.0.8
6 Aug 2021Fix TransformQuery for path longer than 1
8.0.2 – 8.0.76 releases that only update dependencies@graphql-tools/delegate 8.0.7@graphql-tools/utils 8.0.2@graphql-tools/schema 8.0.2Show each
- 8.0.76 Aug 2021@graphql-tools/delegate 8.0.7
- 8.0.65 Aug 2021@graphql-tools/delegate 8.0.6
- 8.0.55 Aug 2021@graphql-tools/delegate 8.0.5
- 8.0.44 Aug 2021@graphql-tools/utils 8.0.2@graphql-tools/delegate 8.0.4@graphql-tools/schema 8.0.2
- 8.0.328 Jul 2021@graphql-tools/utils 8.0.1@graphql-tools/delegate 8.0.3@graphql-tools/schema 8.0.1
- 8.0.228 Jul 2021@graphql-tools/delegate 8.0.2
8.0.1
28 Jul 2021delegate: Fix ESM import
Patch Changes
delegate: Fix ESM import
8.0.0
28 Jul 2021- Breaking
BREAKING CHANGE
- Breaking
ExecutionParams type replaced by Request type
rootValue property is now a part of the Request type.
When delegating with delegateToSchema, rootValue can be set multiple ways:
When using wrapSchema/stitchSchemas, a subschemaConfig can specify the createProxyingResolver function which can pass whatever rootValue it wants to delegateToSchema as above.
- Breaking
BREAKING CHANGES;
It doesn't rely on info.operation.operationType to allow the user to call an operation from different root type. And it doesn't call getOperationAST again and again to get operation type from the document/operation because we have it in Request and ExecutionParams #3166
Improvements;
Batch executor is memoized by
executorreference butcreateDefaultExecutordidn't memoize the default executor so this memoization wasn't working correctly onbatch-executeside. github.com/ardatan/graphql-tools/blob/remove-in…
Major Changes
- Breaking
BREAKING CHANGE
makeRemoteExecutableSchemahas been removed.You can use
wrapSchemainstead
- Breaking
ExecutionParams type replaced by Request type
rootValue property is now a part of the Request type.
When delegating with delegateToSchema, rootValue can be set multiple ways:
when using a custom executor, the custom executor can utilize a rootValue in whichever custom way it specifies.
when using the default executor (execute/subscribe from graphql-js): -- rootValue can be passed to delegateToSchema via a named option -- rootValue can be included within a subschemaConfig -- otherwise, rootValue is inferred from the originating schema
When using wrapSchema/stitchSchemas, a subschemaConfig can specify the createProxyingResolver function which can pass whatever rootValue it wants to delegateToSchema as above.
- Breaking
BREAKING CHANGES;
Rename
RequesttoExecutionRequestAdd required
operationType: OperationTypeNodefield inExecutionRequestAdd
contextincreateRequestandcreateRequestInfoinstead ofdelegateToSchema
It doesn't rely on info.operation.operationType to allow the user to call an operation from different root type. And it doesn't call getOperationAST again and again to get operation type from the document/operation because we have it in Request and ExecutionParams #3166
Improvements;
Memoize
defaultExecutorfor a singleGraphQLSchemaso allowgetBatchingExecutorto memoizebatchingExecutorcorrectly.And there is no different
defaultExecutoris created forsubscriptionand other operation types. Only one executor is used.
Batch executor is memoized by
executorreference butcreateDefaultExecutordidn't memoize the default executor so this memoization wasn't working correctly onbatch-executeside. github.com/ardatan/graphql-tools/blob/remove-in… - Breaking
BREAKING CHANGE
Now it uses the native
AggregateErrorimplementation. The major difference is the individual errors are kept undererrorsproperty instead of the object itself withSymbol.iterator.
// From; for (const error of aggregateError) // To; for (const error of aggregateError.errors)
- Breaking
BREAKING CHANGE
Remove unnecessary
introspectSchemaSync,introspectSchemaalready handles sync execution
- Breaking
getDirectives: Preserve order around repeatable directives
BREAKING CHANGE: getDirectives now always return an array of individual DirectiveAnnotation objects consisting of
nameandargsproperties.New useful function
getDirectivereturns an array of objects representing any args for each use of a single directive (returning the empty object{}when a directive is used without arguments).Note: The
getDirectivefunction returns an array even when the specified directive is non-repeatable. This is because one use of this function is to throw an error if more than one directive annotation is used for a non repeatable directive!When specifying directives in extensions, one can use either the old or new format.
- Breaking
BREAKING CHANGE
Remove Subscriber and use only Executor
Now
Executorcan receiveAsyncIterableand subscriptions will also be handled byExecutor. This is a future-proof change for defer, stream and live queries
- 7.x
7.0.8
1 May 2021Only updates dependencies:@graphql-tools/delegate 7.1.5@graphql-tools/schema 7.1.5
7.0.7
30 Apr 2021TransformQuery: Pass delegation context to query and result transformers for required flexibility
Patch Changes
TransformQuery: Pass delegation context to query and result transformers for required flexibility
7.0.6
28 Apr 2021Use value-or-promise to streamline working with sync values or async promises
Patch Changes
Use value-or-promise to streamline working with sync values or async promises
7.0.5
24 Dec 2020Reading the note…
7.0.4
3 Dec 2020Reading the note…
7.0.3
30 Nov 2020Reading the note…
7.0.2
30 Nov 2020Reading the note…
7.0.1
27 Oct 2020transformedSchema argument within transformSchema method of transforms should be optional. The HoistField transform incorrectly set it to non-optional, breaking Typescript builds -- presumably when used with strict compilation.
7.0.0
23 Oct 2020- Breaking
Breaking Changes:
- Breaking
Resolver validation options should now be set to
error,warnorignorerather thantrueorfalse. In previous versions, some of the validators caused errors to be thrown, while some issued warnings. This changes brings consistency to validator behavior. - Breaking
The
allowResolversNotInSchemahas been renamed torequireResolversToMatchSchema, to harmonize the naming convention of all the validators. The default setting ofrequireResolversToMatchSchemaiserror, matching the previous behavior.
Major Changes
- Breaking
Breaking Changes:
Schema Generation and Decoration API (
@graphql-tools/schema)- Breaking
Resolver validation options should now be set to
error,warnorignorerather thantrueorfalse. In previous versions, some of the validators caused errors to be thrown, while some issued warnings. This changes brings consistency to validator behavior. - Breaking
The
allowResolversNotInSchemahas been renamed torequireResolversToMatchSchema, to harmonize the naming convention of all the validators. The default setting ofrequireResolversToMatchSchemaiserror, matching the previous behavior.
Schema Delegation (
delegateToSchema&@graphql-tools/delegate)- Breaking
The
delegateToSchemareturn 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,getErrorsByPathSegmentfunctions. Only external errors with missing or invalid paths must still be preserved by annotating the remote object with special properties. The newgetUnpathedErrorsfunction is therefore necessary for retrieving only these errors. Note also the newannotateExternalObjectandmergeExternalObjectsfunctions, as well as the renaming ofhandleResulttoresolveExternalValue. - Breaking
Transform types and the
applySchemaTransformsare now relocated to thedelegatepackage;applyRequestTransforms/applyResultTransformsfunctions have been deprecated, however, as this functionality has been replaced since v6 by theTransformerabstraction. - Breaking
The
transformRequest/transformResultmethods are now provided additionaldelegationContextandtransformationContextarguments -- these were introduced in v6, but previously optional. - Breaking
The
transformSchemamethod may wish to create additional delegating resolvers and so it is now provided thesubschemaConfigand final (non-executable)transformedSchemaparameters. As in v6, thetransformSchemais 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 individualtransformSchemamethods also get access to the result of the first run, if necessary, they can create additional wrapping schema proxying resolvers. - Breaking
applySchemaTransformsparameters have been updated to match and support thetransformSchemaparameters above.
Remote Schemas & Wrapping (
wrapSchema,makeRemoteExecutableSchema, and@graphql-tools/wrap)- Breaking
wrapSchemaandgenerateProxyingResolversnow only take a single options argument with named properties of typeSubschemaConfig. The previously possible shorthand version with first argument consisting of aGraphQLSchemaand second argument representing the transforms should be reworked as aSubschemaConfigobject. - Breaking
Similarly, the
ICreateProxyingResolverOptionsinterface that provides the options for thecreateProxyingResolverproperty ofSubschemaConfigoptions has been adjusted. Theschemaproperty previously could be set to aGraphQLSchemaor aSubschemaConfigobject. This property has been removed in favor of asubschemaConfigproperty that will always be aSubschemaConfigobject. Thetransformsproperty has been removed; transforms should be included within theSubschemaConfigobject.` - Breaking
The format of the wrapping schema has solidified. All non-root fields are expected to use identical resolvers, either
defaultMergedResolveror a custom equivalent, with root fields doing the hard work of proxying. Support for custom merged resolvers throughtcreateMergedResolverhas been deprecated, as custom merging resolvers conflicts when using stitching's type merging, where resolvers are expected to be identical across subschemas. - Breaking
The
WrapFieldstransform'swrappingResolveroption 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 asTransformRootFieldsorTransformObjectFields. - Breaking
The
ExtendSchematransform has been removed, as it is conceptually simpler just to usestitchSchemaswith one subschema. - Breaking
The
ReplaceFieldsWithFragment,AddFragmentsByField,AddSelectionSetsByField, andAddMergedTypeSelectionSetstransforms has been removed, as they are superseded by theAddSelectionSetsandVisitSelectionSetstransforms. TheAddSelectionSetspurposely 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 theparseSelectionSetfunction from@graphql-tools/utils.
Schema Stitching (
stitchSchemas&@graphql-tools/stitch)- Breaking
stitchSchemas'smergeTypesoption is now true by default! This causes theonTypeConflictoption to be ignored by default. To useonTypeConflictto select a specific type instead of simply merging, simply setmergeTypesto false. - Breaking
schemasargument has been deprecated, usesubschemas,typeDefs, ortypes, depending on what you are stitching. - Breaking
When using batch delegation in type merging, the
argsFromKeysfunction is now set only via theargsFromKeysproperty. Previously, ifargsFromKeyswas absent, it could be read fromargs. - Breaking
Support for fragment hints has been removed in favor of selection set hints.
- Breaking
stitchSchemasnow processes allGraphQLSchemaandSubschemaConfigsubschema input into newSubschemaobjects, handling schema config directives such aso@computedas well as generating the final transformed schema, stored as thetransformedSchemaproperty, if transforms are used. Signatures of theonTypeConflict,fieldConfigMerger, andinputFieldConfigMergerhave been updated to include metadata related to the original and transformed subschemas. Note the property name change foronTypeConflictfromschematosubschema.
Mocking (
addMocksToSchemaand@graphql-tools/mock)- Breaking
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, andinfowithparentavailable asthisrather than as the first argument.
Other Utilities (
@graphql-tools/utils)- Breaking
filterSchema'sfieldFilterwill now filter all fields across Object, Interface, and Input types. For the previous Object-only behavior, switch to theobjectFieldFilteroption. - Breaking
Unused
fieldNodesutility functions have been removed. - Breaking
Unused
typeContainsSelectionSetfunction has been removed, andtypesContainSelectionSethas been moved to thestitchpackage. - Breaking
Unnecessary
Operationtype has been removed in favor ofOperationTypeNodefrom upstream graphql-js. - Breaking
As above,
applySchemaTransforms/applyRequestTransforms/applyResultTransformshave been removed from theutilspackage, as they are implemented elsewhere or no longer necessary.
Related Issues
- 6.x
6.2.4
30 Sep 2020enhance(HoistFields): allow arguments
Bump all packages to allow adjustments
Patch Changes
enhance(HoistFields): allow arguments
Bump all packages to allow adjustments
6.2.3
19 Sep 20206.2.2
12 Sep 2020Reading the note…
6.2.1
4 Sep 2020Reading the note…
6.2.0
1 Sep 2020Reading the note…
6.1.0
26 Aug 2020Reading the note…
6.0.18
11 Aug 2020Reading the note…
6.0.17
10 Aug 2020Reading the note…
6.0.16
5 Aug 2020Reading the note…
6.0.15
22 Jul 2020Reading the note…
6.0.14
16 Jul 2020Reading the note…
6.0.13
14 Jul 2020Reading the note…
6.0.12
2 Jul 2020Reading the note…
6.0.11
25 Jun 2020Reading the note…
6.0.10
15 Jun 2020Reading the note…
6.0.9
8 Jun 2020Reading the note…
6.0.8
6 Jun 2020Reading the note…
6.0.7
3 Jun 2020Reading the note…
6.0.6
2 Jun 2020Reading the note…
6.0.5
30 May 2020Reading the note…
6.0.4
29 May 2020Reading the note…
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.