@graphql-tools/delegate
12.3.4 · 12 Nov 2026MIT15.8M / weekRepositorynpmAtom feed
12.3.4 is the newest release of 12.x.
In short
1 fixed
Release note
The section about @graphql-tools/delegate of a note shared by several packages.
@graphql-tools/delegate@12.0.19
Patch Changes
Fix
@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:Forward every field listed in
@providesto that subgraph, even when the client never asked for them.After receiving the response, plan additional delegations to the owner subgraph for
@provides-covered fields whenever the providing subgraph declared them as@external, even though the data was already returned.
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:
Only the
@providesfields the client actually selected are forwarded to the providing subgraph (request side).The delegation planner now recognises
@providesdeclarations at every nested level (e.g.@provides(fields: "nested { nestedNested { name description } }")) and@providesdeclarations made via inline fragments on union/interface members (e.g.@provides(fields: "... on Book { title }")), so the gateway no longer round-trips to the owner subgraph for fields that the providing subgraph has already returned.Fragment spreads in the client query are correctly handled when selecting nested
@provides-covered fields. Previously, using a fragment spread (e.g....MyFrag) for nested@externalfields could cause an unnecessary delegation to the owner because selection subtraction compared only the spread name with the explicit@providesfields. The planner now resolves fragment spreads before subtracting provided selections, while preserving the fragment type condition and directives when only part of a fragment remains.
Aliases, direct field selections, fragments, fragment spreads,
@include/@skipdirectives wrapping a@providesfield, and nested@providesselections are preserved without unnecessary owner delegations.
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.