@graphql-tools/delegate
12.3.4 · 12 Nov 2026MIT15.8M / weekRepositorynpmAtom feed
219 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 12.x · latest line
12.3.4
12 Nov 2026Reduce allocation during delegation: clone HTTP query results only when the in-flight request has multiple consumers, construct compact fresh null-prototype field metadata maps, and avoid temporary fake-promise wrappers for synchronous composite completion. Preserve shared-request isolation, metadata descriptors, and asynchronous completion behavior.
12.3.3
9 Nov 2026Dependencies updates:
@graphql-tools/delegate@12.3.3
Patch Changes
Dependencies updates:
Updated dependency
@graphql-tools/utils@^12.1.0↗︎ (from^12.0.1, independencies)
12.3.2
2 Nov 2026Only updates a dependency:@graphql-tools/batch-execute 10.3.1
12.3.1
28 Oct 2026Deliver forwarded
@deferpatches for nested list items and avoid recursion throughwrapSchemaover a stitched schemaWhen a subschema has
defer: true, deferred fields inside list items were resolved asnull:IncrementalReceiverdid not merge patches into existing list items (including nested lists), and when the subgraph sent several patches in one chunk, every re-emitted patch carried the chunk'shasNext: false, so only the first one was applied.Without
defer: true, a deferred field owned by another inner subschema underwrapSchemaover a stitched schema calleddefaultMergedResolveron the nested schema with the same parent and recursed. Re-fetch via the nested merged-type resolver for the field owner instead.Settle unsatisfiable stitched leftover fields instead of hanging
When a merged field could only be fetched with a merge key that never
arrived, leftover resolution returned a deferred promise that never
settled and the request hung idle. Track leftover work and, once the
queue is empty, reject unsettled deferreds withSATISFIABILITY_ERROR
(Apollo composition-style message, including selection snippet and
subschema names when set).Closes #2695
12.3.0
23 Oct 2026Summary· from the note as AI read it
Nothing to change: 1 new, 4 fixed.
@graphql-tools/delegate@12.3.0
Minor Changes
Support
@defer/@streamincremental delivery within schema stitching.Gateway-owned
@defer(default): deferred selections are omitted from subgraph requests (only@requires/ key dependencies are kept), so nested@defercan flush before slow fields resolve. Missing fields are filled later via type-merging or source resolvers.Subgraph-forwarded
@defer: setdefer: trueon aSubschemaConfig(ordefer: trueongetStitchedSchemaFromSupergraphSdl) to forward@deferto that subgraph and merge incremental patches viaIncrementalReceiver. Withbatch: trueandbatchingOptions.defer(orsubschema.defer), multi-request batches wrap each root selection in@deferfor subgraph compatibility; results are still collected before DataLoader waiters resolve. Single-request batches pass the AsyncIterable through so the initial payload can flush before deferred patches arrive.Hive Gateway config: extend
deferStreaminstead of a separate flag:deferStream: true // client-facing only (gateway-owned omit) deferStream: { subgraph: true } // also forward @defer to every subgraph deferStream: { subgraph: { users: true, '*': false } } // per-subgraph@graphql-tools/executor-httpaddsmergeIncremental(defaulttrue: legacy growing snapshots). SetmergeIncremental: falseto yield raw multipart parts like the default schema executor. Hive Gateway's@graphql-mesh/transport-httpalways uses passthrough (mergeIncremental: false).IncrementalReceiverprefers raw patches and cheaply tolerates accumulated snapshots (only fills missing keys). The HTTP executor preserveshasNextin accumulate mode.@streamcontinues to be forwarded on field directives as before. List streaming in@graphql-tools/delegateuses a plain async generator (no@repeaterjs/repeaterdependency).Hive Router runtime does not plan incremental delivery yet;
deferStream.subgraphapplies to the stitching federation path.
Patch Changes
Dependencies updates:
Removed dependency
@repeaterjs/repeater@^3.0.6↗︎ (fromdependencies)
Fix type merging for unions queried with inline fragments (graphql-tools#4965 / #4966).
Typical setup: one subschema returns a stub member (
StubMajor { id }) while another resolves the real union members via@merge:# students union Major = StubMajor type StubMajor { id: String! } # majors type Query { major(id: String!): Major @merge(keyField: "id") } union Major = MajorSuccess | MajorErrorClient query:
major { ... on MajorSuccess { id name } ... on MajorError { id code } }Three problems stacked:
@mergeon a union only registered concrete members (MajorSuccess/MajorError), notMajoritself, so aStubMajorresult never triggered merge.MergedTypeInfowas not built for union types, and planners assumed object/interfacegetFields().Expanding a bare merge-key field (
id) on a union into... on StubMajor { id }returned an array from the FIELD visitor; graphql-jsvisitnests that array as one selection instead of splicing it, so execution ignored the fragment and the merge key was never queried (major(id: $id)ran with empty variables).
Fixes:
Register the abstract union/interface name for
@mergeas well as concrete members.Build merge info for unions; treat unions as field-less so the abstract planner re-fetches via inline fragments.
Flatten nested selection arrays after union field expansion so stub keys are actually requested.
This goes beyond the schema-extension workaround discussed on the issue.
12.2.0
8 Sep 2026Support GraphQL 16 with @graphql-tools/utils v12
Preserves GraphQL 16 compatibility while upgrading to
@graphql-tools/utilsv12,@graphql-tools/executorv2, and the compatible@graphql-tools/schemaand@graphql-tools/mergereleases. Consumers now receive consistent resolver and execution request types without conflicts between different GraphQL Tools versions.Stitched and delegated operations handle the new executor variable result shape correctly, including variables used by directives. Resolver execution also supports the executor's cancellation and asynchronous work helpers while remaining compatible with the GraphQL 16
GraphQLResolveInfoAPI.Dependencies updates:
@graphql-tools/delegate@12.2.0
Minor Changes
Support GraphQL 16 with @graphql-tools/utils v12
Preserves GraphQL 16 compatibility while upgrading to
@graphql-tools/utilsv12,@graphql-tools/executorv2, and the compatible@graphql-tools/schemaand@graphql-tools/mergereleases. Consumers now receive consistent resolver and execution request types without conflicts between different GraphQL Tools versions.Stitched and delegated operations handle the new executor variable result shape correctly, including variables used by directives. Resolver execution also supports the executor's cancellation and asynchronous work helpers while remaining compatible with the GraphQL 16
GraphQLResolveInfoAPI.
Patch Changes
Dependencies updates:
Updated dependency
@graphql-tools/executor@^2.0.1↗︎ (from^1.4.13, independencies)Updated dependency
@graphql-tools/schema@^10.1.1↗︎ (from^10.0.29, independencies)Updated dependency
@graphql-tools/utils@^12.0.1↗︎ (from^11.0.0, independencies)
12.1.4
7 Sep 2026Drop prototype polluting keys from subgraph results before merging them
Response keys named
__proto__,constructororprototype, which a client can produce with a field alias, were only filtered at the top level of a merged result. Nested occurrences were passed tomergeDeep, which walks the prototype chain and could end up writing toObject.prototypeorFunction.prototype.Such keys are now removed at every depth of a subgraph result before it takes part in a merge, and
projectDataSelectionSetno longer treats an inherited property as an already projected field.
@graphql-tools/delegate@12.1.4
Patch Changes
Drop prototype polluting keys from subgraph results before merging them
Response keys named
__proto__,constructororprototype, which a client can produce with a field alias, were only filtered at the top level of a merged result. Nested occurrences were passed tomergeDeep, which walks the prototype chain and could end up writing toObject.prototypeorFunction.prototype.Such keys are now removed at every depth of a subgraph result before it takes part in a merge, and
projectDataSelectionSetno longer treats an inherited property as an already projected field.
12.1.3
3 Sep 2026Flush deferred merged fields without blocking the initial payload
Deferred fields on merged entity types are now delegated when their deferred resolvers run instead of being included in the initial delegation plan. This allows the initial payload to be delivered before slower merged subgraph fields resolve.
12.1.2
2 Sep 2026Create new getCoercedVariableValues to support graphql-js 17
12.1.1
27 Jul 2026Fix delegated argument serialization when fields are filtered or renamed
Inline enum values now remain enum literals, and original variable definitions are preserved while still referenced by fragments, selections, directives, or other arguments.
12.1.0
20 Jul 2026Automatically resolve plain merged-type references returned by local stitching resolvers
Local fields introduced through
typeDefsorresolversare wrapped bystitchSchemas. When they return a partial merged type containing a usable key, stitching performs one initial delegation with type merging enabled. The existing stitching planner then handles computed fields,@requiresdependencies, batching, nested entities, and fields owned by other subschemas.defaultMergedResolvernow falls back to the literal field name when an external object does not have the requested response keyPlain resolver data merged into an external object is keyed by field name, so an aliased request used to resolve to
nulleven though the value was there:{ person { fullName: name } }// merged object carries resolver data by field name { id: '1', name: 'Local' }Previously
fullNamewasnullbecause only the alias was looked up. Now it resolves to'Local'by field name, matching plain graphql-js behavior. When the response key is present (e.g. the field came from a subschema), it is still preferred.
12.0.20
18 Jul 2026Fix delegated argument variable type compatibility
Avoid reusing variables whose types are incompatible with target schema argument types, and create correctly typed variables instead.
Fix enum argument serialization when delegating to a field removed from the transformed schema.
When a delegated query field is filtered from the transformed schema, its arguments now use the original subschema for type lookup. This ensures enum values are sent as typed variables instead of invalid quoted enum literals while preserving input field transforms for fields that remain exposed.
12.0.19
13 Jul 2026Fix
@providesso the gateway only requests the provided fields the client actually selected, and stops delegating to the owner subgraph when@providesalready covers the request.Previously, when a subgraph declared
@provides(fields: "...")on a field, the gateway would still:For example with:
# subgraph B (provider) type Query { entity: Entity @provides(fields: "name description") } type Entity @key(fields: "id") { id: ID! name: String! @external description: String! @external }a client query of
{ entity { id name } }would still cause the gateway to ask subgraph B fordescriptionand fetchnameagain from subgraph A (the owner ofEntity).After this fix:
Aliases, direct field selections, fragments, fragment spreads,
@include/@skipdirectives wrapping a@providesfield, and nested@providesselections are preserved without unnecessary owner delegations.
12.0.18
3 Jul 2026Only updates a dependency:@graphql-tools/batch-execute 10.0.9
12.0.17
1 Jun 2026Fix cross-subgraph delegation for unavailable fields selected through inline fragments or fragment spreads on interface fields.
The fix in
extractUnavailableFieldsFromSelectionSetwithinextractUnavailableFields.tsnow preserves the fragment wrapper and type condition, so concrete-type fields do not lose their type context and get treated as missing.
12.0.16
7 May 2026Fix
@streamdirective not working for federated subgraphs with non-null scalar list return types.Two bugs were addressed in
delegateRequest:
12.0.15
1 May 2026Fix incorrect error path when delegating a single type to a list type in a subschema.
When using schema stitching with type merging (e.g., a supergraph
bookfield delegating to a subschemabookslist field via batch delegation), errors from the subschema now correctly report the path as seen in the supergraph (e.g.,['book', 'title']) instead of including an unexpected array index (e.g.,['book', 0, 'title']).Also ensures
onLocatedErroris passed through in all branches ofgetDelegationContext.
12.0.14
15 Apr 2026Fix redundant type merging calls when subschemas have no explicit name.
The fallback name-based matching in
resolveExternalValue(introduced in #1557) incorrectly matched unrelated subschemas when neither had an explicitnameset, becauseundefined === undefinedevaluated totrue. This caused type merging to trigger even when fetching a type directly from its source subschema, resulting in a redundant second call.
12.0.13
3 Apr 2026Only updates a dependency:@graphql-tools/batch-execute 10.0.8
12.0.12
17 Mar 2026Optimizations to select ONLY required fields when fetching the missing fields from other subgraphs
12.0.11
16 Mar 2026Only updates a dependency:@graphql-tools/batch-execute 10.0.7
12.0.10
15 Mar 2026Fix missing NPM provenance attestation by enabling
npmPublishProvenancein Yarn configuration
@graphql-tools/delegate@12.0.10
Patch Changes
Fix missing NPM provenance attestation by enabling
npmPublishProvenancein Yarn configuration
12.0.9
10 Mar 2026Fix redundant extra calls to the same subschema in case of
@canonicalannotation
12.0.8
23 Feb 2026Reuse the existing variables from the gateway request correctly
When you have an argument in a nested field that uses the variable from the gateway request like below;
query GetArticles($date: Datetime!) { view { articlesByDate(date: $date) { id title publishedAt } } }And if
Datetimeis renamed fromDateTimein the original schema, the transform wasn't applied correctly to the variable definitions, and the delegation failed with an error in the subgraph likeDatetimeis not known.
12.0.7
13 Feb 2026Respect existing variable definitions from the gateway request;
query ($var1: String = "default") { rootField(arg1: $var1) }query ($arg1: String = "default") { rootField(arg1: 2) { someField(arg2: $arg1) } }In that case it should be delegated as:
query ($arg1: String = "default", $rootField_arg1: String = "default") { rootField(arg1: $rootField_arg1) { someField(arg2: $arg1) } }
12.0.6
4 Feb 2026Handle the type merging order correctly with custom labels and percentage labels for progressive override
12.0.5
2 Feb 2026Do not add required fields if they are already present in the original selection set.
For example in Federation;
If you have a subgraph schema like below;
type Book @key(fields: "upc otherUpc shop { id }") { upc: ID! otherUpc: ID! shop: Shop! } type Shop @key(fields: "id") { id: ID! name: String! location: Location! }And when you send a mutation like below;
mutation { buyBook(input: { bookUpc: "test" }) { book { upc otherUpc shop { id name location { address1 city state } } } } }Previously, the gateway would add the required key fields again to the selection set when resolving the type like below;
mutation { buyBook(input: { bookUpc: "test" }) { book { upc otherUpc - upc - otherUpc - shop { id } # from the key fields shop { id name location { address1 city state } } } } }
12.0.4
8 Jan 2026Dependencies updates:
Patch Changes
Dependencies updates:
Updated dependency
@graphql-tools/utils@^11.0.0↗︎ (from^10.10.3, independencies)
12.0.3
7 Jan 2026Delegate variable values correctly;
When delegating requests with variables that include nested arrays, ensure that null values are preserved and passed correctly to the subschema. This fix addresses issues where null values in nested arrays were not handled properly during delegation.
Let's say we have the following schema;
makeExecutableSchema({ typeDefs: /* GraphQL */ ` type Query { test(input: InputType!): [String!] } input InputType { value: [String!] } `, resolvers: { Query: { test: (_, args) => { // Returns the incoming variable value return args.input.value; }, }, } });When delegating a query with a variable like:
{ "query": "query Test($value: [String!]) { test(input: { value: $value } ) }", "variables": { "value": null } }And the result was
{ "data": { "test": [] } }But with this fix, the result will correctly be:
{ "data": { "test": null } }
12.0.2
3 Dec 2025Use
getDefinedRootTypeinstead ofschema.getRootTypefor GraphQL v15 compatibility
12.0.1
1 Dec 2025Fix leftover handling 2nd take
12.0.0
1 Dec 2025- Breaking
Breaking changes in
createRequestfunction;Breaking changes in
delegateRequestanddelegateToSchemafunctions; Avoid extra
__typenamein the root selectionquery { - __typename hello }Handle leftovers recursively but in async
Fixesrequires-circulartest suite's second case on federation audit repository
- 11.x
11.1.3
19 Nov 2025Dependencies updates:
@graphql-tools/delegate@11.1.3
Patch Changes
Dependencies updates:
Updated dependency
@graphql-tools/executor@^1.4.13↗︎ (from^1.4.11, independencies)Updated dependency
@graphql-tools/schema@^10.0.29↗︎ (from^10.0.27, independencies)Updated dependency
@graphql-tools/utils@^10.10.3↗︎ (from^10.10.1, independencies)
11.1.2
7 Nov 2025Dependencies updates:
Dependencies updates:
Dependencies updates:
@graphql-tools/delegate@11.1.2
Patch Changes
Dependencies updates:
Updated dependency
@graphql-tools/executor@^1.4.11↗︎ (from^1.4.9, independencies)Updated dependency
@graphql-tools/schema@^10.0.27↗︎ (from^10.0.25, independencies)Updated dependency
@graphql-tools/utils@^10.10.1↗︎ (from^10.9.1, independencies)Removed dependency
dset@^3.1.2↗︎ (fromdependencies)
Dependencies updates:
Updated dependency
@graphql-tools/utils@^10.10.1↗︎ (from^10.10.0, independencies)Removed dependency
dset@^3.1.2↗︎ (fromdependencies)
Dependencies updates:
Updated dependency
@graphql-tools/executor@^1.4.11↗︎ (from^1.4.10, independencies)Updated dependency
@graphql-tools/schema@^10.0.27↗︎ (from^10.0.26, independencies)
11.1.1
1 Nov 2025Dependencies updates:
@graphql-tools/delegate@11.1.1
Patch Changes
Dependencies updates:
Updated dependency
@graphql-tools/executor@^1.4.10↗︎ (from^1.4.9, independencies)Updated dependency
@graphql-tools/schema@^10.0.26↗︎ (from^10.0.25, independencies)Updated dependency
@graphql-tools/utils@^10.10.0↗︎ (from^10.9.1, independencies)
11.1.0
27 Oct 2025Progressive Override for Safer Field Migrations
Introduces Progressive Override, allowing you to safely migrate fields between subgraphs using the
@overridedirective with a label. Control the rollout using custom logic in the gateway (e.g., percentage, headers) or the built-in percent(x) label for gradual, incremental traffic migration.Detailed documentation can be found here.
Apply type-merging correctly in extended fields
Correct error paths in case of batch delegation with the same error
@graphql-tools/delegate@11.1.0
Minor Changes
Progressive Override for Safer Field Migrations
Introduces Progressive Override, allowing you to safely migrate fields between subgraphs using the
@overridedirective with a label. Control the rollout using custom logic in the gateway (e.g., percentage, headers) or the built-in percent(x) label for gradual, incremental traffic migration.Detailed documentation can be found here.
Patch Changes
Apply type-merging correctly in extended fields
Correct error paths in case of batch delegation with the same error
Correctly resolve circular @requires in different subgraphs
11.0.1
15 Sep 2025Dependencies updates:
Patch Changes
Dependencies updates:
Updated dependency
@whatwg-node/promise-helpers@^1.3.2↗︎ (from^1.3.0, independencies)
11.0.0
4 Sep 2025- Breaking
Drop Node 18 support
Least supported Node version is now v20.
Added
subgraphNametoExecutionRequestfor easier plugin developpment.Fixed subgraph name being lost when execution requests get batched together.
Major Changes
- Breaking
Drop Node 18 support
Least supported Node version is now v20.
Minor Changes
Added
subgraphNametoExecutionRequestfor easier plugin developpment.
Patch Changes
Fixed subgraph name being lost when execution requests get batched together.
- 10.x
10.2.23
1 Aug 2025Dependencies updates:
Patch Changes
Dependencies updates:
Updated dependency
@graphql-tools/executor@^1.4.9↗︎ (from^1.4.8, independencies)Updated dependency
@graphql-tools/schema@^10.0.25↗︎ (from^10.0.24, independencies)Updated dependency
@graphql-tools/utils@^10.9.1↗︎ (from^10.9.0, independencies)
10.2.22
23 Jul 2025Dependencies updates:
Patch Changes
Dependencies updates:
Updated dependency
@graphql-tools/executor@^1.4.8↗︎ (from^1.4.7, independencies)Updated dependency
@graphql-tools/schema@^10.0.24↗︎ (from^10.0.11, independencies)Updated dependency
@graphql-tools/utils@^10.9.0↗︎ (from^10.8.1, independencies)
10.2.21
7 Jul 2025Filter selection sets recursively when finalizing gateway requests
Because abstract types can be nested.
10.2.20
26 Jun 2025Relocate each error in multi-error ExecutionResult
Handling errors now works the same for both single-error and multi-error ExecutionResults.
Remove trailing spaces when merging multi-error responses
Call onLocatedError hook from delegation context for each error in multi-error ExecutionResult
10.2.19
2 Jun 2025Only updates a dependency:@graphql-tools/batch-execute 9.0.17
10.2.18
16 May 2025Optimizes
@provideshandling by avoiding the generation of new query plans when a parent subgraph already supplies the requested fields.
Patch Changes
Optimizes
@provideshandling by avoiding the generation of new query plans when a parent subgraph already supplies the requested fields.Refactors and inlines
subtractSelectionSetsto compute leftover selections.Threads a
providedSelectionNodethrough planning to subtract out provided fields early.Updates stitching and federation logic to conditionally skip planning when selections are already available.
10.2.17
7 Apr 2025Errors should not be swallowed when it is thrown from the shared root
Do not use the global `PromiseWithResolvers`
10.2.16
25 Mar 2025Dependencies updates:
Patch Changes
Dependencies updates:
Updated dependency
@whatwg-node/promise-helpers@^1.3.0↗︎ (from^1.2.5, independencies)
10.2.15
20 Mar 2025Dependencies updates:
Patch Changes
Dependencies updates:
Updated dependency
@whatwg-node/promise-helpers@^1.2.5↗︎ (from^1.0.0, independencies)
10.2.14
11 Mar 2025Dependencies updates:
Remove the index from the batched error;
In case of batched delegation (for example multiple book entitites fetched from different places from a field), remove the index from the error message, as it is not relevant in this case.
Patch Changes
Dependencies updates:
Added dependency
@whatwg-node/promise-helpers@^1.0.0↗︎ (todependencies)
Remove the index from the batched error;
In case of batched delegation (for example multiple book entitites fetched from different places from a field), remove the index from the error message, as it is not relevant in this case.
10.2.13
14 Feb 2025When a field with
@skipand@includedirectives in a selection set throws, show the correct error// Query query myQuery($toInclude: Boolean! = false) { user(id: 1) { id name username totalReviews @include(if: $toInclude) # If this throws, show the actual error instead of `Argument \"if\" of required type \"Boolean!\" was provided the variable` error } } // Variables { "toInclude": true }
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.