@graphql-tools/delegate
12.3.4 · 12 Nov 2026MIT15.8M / weekRepositorynpmAtom feed
12.3.4 is the newest release of 12.x.
Summary· from the note as AI read it
No actionNothing to change: 1 new, 4 fixed.
New
- Support
@defer/@streamincremental delivery within schema stitching.
In short
1 new4 fixed3 internal
Release note
The section about @graphql-tools/delegate of a note shared by several packages.
@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.
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.