Packages

@graphql-tools/delegate

12.3.4 · 12 Nov 2026MIT15.8M / weekRepositorynpmAtom feed

Your version

219 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 12.x · latest line
  2. 12.3.4

    12 Nov 2026
    • Reduce 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.

  3. 12.3.3

    9 Nov 2026
    • Dependencies updates:

  4. 12.3.2

    2 Nov 2026

    Only updates a dependency:@graphql-tools/batch-execute 10.3.1

  5. 12.3.1

    28 Oct 2026
    • Deliver forwarded @defer patches for nested list items and avoid recursion through wrapSchema over a stitched schema

      When a subschema has defer: true, deferred fields inside list items were resolved as null: IncrementalReceiver did 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's hasNext: false, so only the first one was applied.

      Without defer: true, a deferred field owned by another inner subschema under wrapSchema over a stitched schema called defaultMergedResolver on 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 with SATISFIABILITY_ERROR
      (Apollo composition-style message, including selection snippet and
      subschema names when set).

      Closes #2695

  6. 12.3.0

    23 Oct 2026

    Summary· from the note as AI read it

    Nothing to change: 1 new, 4 fixed.

  7. 12.2.1

    8 Oct 2026
    • Fix compatibility with GraphQL 14 and 15 by avoiding runtime access to the OperationTypeNode enum, which is only available in GraphQL 16 and later

      Closes #2643

  8. 12.2.0

    8 Sep 2026
    • Support GraphQL 16 with @graphql-tools/utils v12

      Preserves GraphQL 16 compatibility while upgrading to @graphql-tools/utils v12, @graphql-tools/executor v2, and the compatible @graphql-tools/schema and @graphql-tools/merge releases. 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 GraphQLResolveInfo API.

    • Dependencies updates:

  9. 12.1.4

    7 Sep 2026
    • Drop prototype polluting keys from subgraph results before merging them

      Response keys named __proto__, constructor or prototype, which a client can produce with a field alias, were only filtered at the top level of a merged result. Nested occurrences were passed to mergeDeep, which walks the prototype chain and could end up writing to Object.prototype or Function.prototype.

      Such keys are now removed at every depth of a subgraph result before it takes part in a merge, and projectDataSelectionSet no longer treats an inherited property as an already projected field.

  10. 12.1.3

    3 Sep 2026
    • Flush 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.

  11. 12.1.2

    2 Sep 2026
    • Create new getCoercedVariableValues to support graphql-js 17

  12. 12.1.1

    27 Jul 2026
    • Fix 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.

  13. 12.1.0

    20 Jul 2026
    • Automatically resolve plain merged-type references returned by local stitching resolvers

      Local fields introduced through typeDefs or resolvers are wrapped by stitchSchemas. 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, @requires dependencies, batching, nested entities, and fields owned by other subschemas.

    • defaultMergedResolver now falls back to the literal field name when an external object does not have the requested response key

      Plain resolver data merged into an external object is keyed by field name, so an aliased request used to resolve to null even though the value was there:

      {
        person {
          fullName: name
        }
      }
      // merged object carries resolver data by field name
      { id: '1', name: 'Local' }

      Previously fullName was null because 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.

  14. 12.0.20

    18 Jul 2026
    • Fix 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.

  15. 12.0.19

    13 Jul 2026
    • Fix @provides so the gateway only requests the provided fields the client actually selected, and stops delegating to the owner subgraph when @provides already 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 for description and fetch name again from subgraph A (the owner of Entity).

      After this fix:

      Aliases, direct field selections, fragments, fragment spreads, @include/@skip directives wrapping a @provides field, and nested @provides selections are preserved without unnecessary owner delegations.

  16. 12.0.18

    3 Jul 2026

    Only updates a dependency:@graphql-tools/batch-execute 10.0.9

  17. 12.0.17

    1 Jun 2026
    • Fix cross-subgraph delegation for unavailable fields selected through inline fragments or fragment spreads on interface fields.

      The fix in extractUnavailableFieldsFromSelectionSet within extractUnavailableFields.ts now preserves the fragment wrapper and type condition, so concrete-type fields do not lose their type context and get treated as missing.

  18. 12.0.16

    7 May 2026
    • Fix @stream directive not working for federated subgraphs with non-null scalar list return types.

      Two bugs were addressed in delegateRequest:

  19. 12.0.15

    1 May 2026
    • Fix 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 book field delegating to a subschema books list 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 onLocatedError is passed through in all branches of getDelegationContext.

  20. 12.0.14

    15 Apr 2026
    • Fix 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 explicit name set, because undefined === undefined evaluated to true. This caused type merging to trigger even when fetching a type directly from its source subschema, resulting in a redundant second call.

  21. 12.0.13

    3 Apr 2026

    Only updates a dependency:@graphql-tools/batch-execute 10.0.8

  22. 12.0.12

    17 Mar 2026
    • Optimizations to select ONLY required fields when fetching the missing fields from other subgraphs

  23. 12.0.11

    16 Mar 2026

    Only updates a dependency:@graphql-tools/batch-execute 10.0.7

  24. 12.0.10

    15 Mar 2026
    • Fix missing NPM provenance attestation by enabling npmPublishProvenance in Yarn configuration

  25. 12.0.9

    10 Mar 2026
    • Fix redundant extra calls to the same subschema in case of @canonical annotation

  26. 12.0.8

    23 Feb 2026
    • Reuse 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 Datetime is renamed from DateTime in the original schema, the transform wasn't applied correctly to the variable definitions, and the delegation failed with an error in the subgraph like Datetime is not known.

  27. 12.0.7

    13 Feb 2026
    • Respect 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)
        }
      }
  28. 12.0.6

    4 Feb 2026
    • Handle the type merging order correctly with custom labels and percentage labels for progressive override

  29. 12.0.5

    2 Feb 2026
    • Do 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
                      }
                  }
              }
          }
      }
  30. 12.0.4

    8 Jan 2026
    • Dependencies updates:

  31. 12.0.3

    7 Jan 2026
    • Delegate 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
          }
      }
  32. 12.0.2

    3 Dec 2025
    • Use getDefinedRootType instead of schema.getRootType for GraphQL v15 compatibility

  33. 12.0.1

    1 Dec 2025
    • Fix leftover handling 2nd take

  34. 12.0.0

    1 Dec 2025
    • Breaking

      Breaking changes in createRequest function;

      Breaking changes in delegateRequest and delegateToSchema functions;

    • Avoid extra __typename in the root selection

      query {
      - __typename
        hello
      }
    • Handle leftovers recursively but in async
      Fixes requires-circular test suite's second case on federation audit repository

  35. 11.x
  36. 11.1.3

    19 Nov 2025
    • Dependencies updates:

  37. 11.1.2

    7 Nov 2025
    • Dependencies updates:

    • Dependencies updates:

    • Dependencies updates:

  38. 11.1.1

    1 Nov 2025
    • Dependencies updates:

  39. 11.1.0

    27 Oct 2025
    • Progressive Override for Safer Field Migrations

      Introduces Progressive Override, allowing you to safely migrate fields between subgraphs using the @override directive 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

  40. 11.0.1

    15 Sep 2025
    • Dependencies updates:

  41. 11.0.0

    4 Sep 2025
    • Breaking

      Drop Node 18 support

      Least supported Node version is now v20.

    • Added subgraphName to ExecutionRequest for easier plugin developpment.

    • Fixed subgraph name being lost when execution requests get batched together.

  42. 10.x
  43. 10.2.23

    1 Aug 2025
    • Dependencies updates:

  44. 10.2.22

    23 Jul 2025
    • Dependencies updates:

  45. 10.2.21

    7 Jul 2025
    • Filter selection sets recursively when finalizing gateway requests

      Because abstract types can be nested.

  46. 10.2.20

    26 Jun 2025
    • Relocate 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

  47. 10.2.19

    2 Jun 2025

    Only updates a dependency:@graphql-tools/batch-execute 9.0.17

  48. 10.2.18

    16 May 2025
    • Optimizes @provides handling by avoiding the generation of new query plans when a parent subgraph already supplies the requested fields.

  49. 10.2.17

    7 Apr 2025
    • Errors should not be swallowed when it is thrown from the shared root

    • Do not use the global `PromiseWithResolvers`

  50. 10.2.16

    25 Mar 2025
    • Dependencies updates:

  51. 10.2.15

    20 Mar 2025
    • Dependencies updates:

  52. 10.2.14

    11 Mar 2025
    • Dependencies 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.

      See the test

  53. 10.2.13

    14 Feb 2025
    • When a field with @skip and @include directives 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.