github ardatan/graphql-tools release-1792686196000
October 22, 2026

2 hours ago

@graphql-tools/mock@10.1.0

Minor Changes

  • #8570 171adc3 Thanks @ardatan! - Query and Mutation mocks now receive the field's resolved arguments. Subscription mocks receive
    the same map when resolve runs (an event is yielded); the default subscriber does not yield.

    A mock is a type factory, not a resolver. The value that identifies an operation field is its
    argument map after GraphQL coercion: user(id: ID!) always has id, whether the client sent a
    literal or a variable. That is what you assert on (jest.fn() / toHaveBeenCalledWith) and what
    you use to return the right mock.

    context is the same request-wide object for every field (auth, loaders). It does not distinguish
    user(id: "1") from user(id: "2"). Use the resolvers option of addMocksToSchema when you need
    context, info, or the mock store; the rest of the fields can still come from mocks.

    mocks.Query = jest.fn(() => ({ ... })) is called with { id: 'user-1' } when user(id:) is
    resolved. Nested type mocks such as User stay factories with no arguments.

  • #8566 2e28f6c Thanks @ardatan! - Lists generated by the mock store can set a length with defaultListLength, and MockList now passes each item's index to its mock function.

    Without an explicit list mock the store always produced two items. addMocksToSchema({ schema, defaultListLength: 0 }) (or createMockStore) now controls that length. Auto-generated list items pass their index to scalar mocks, and new MockList(n, (index) => ...) receives index so items can vary by position.

  • #8568 822a0c7 Thanks @ardatan! - MockStore get and set now accept GraphQL input object types.

    Input types were rejected as "not an object or interface", so mutation inputs could not be stored for later CRUD-style mocks. The store now treats input objects like other named object types.

Patch Changes

  • #8565 8c50a7d Thanks @ardatan! - Mocks set on list items now apply to fields that take arguments.

    The store keys a field with its arguments (membership:{"param":"test"}). Nested mocks such as { membership: null } were stored under the bare field name, so a query that passed arguments generated a new default instead of using the override. Lookups now fall back to the un-argued field when the exact argument key is missing.

  • Updated dependencies [7fbc6e7, fe44242, 5ceed9d]:

    • @graphql-tools/utils@13.1.3
    • @graphql-tools/schema@11.0.6

@graphql-tools/executor@4.1.4

Patch Changes

  • #8576 e0115d8 Thanks @ardatan! - Abort listeners on a request AbortSignal are removed when query/mutation execution finishes, not only when the signal aborts.

    addEventListener('abort', listener, { once: true }) drops the listener only when abort fires. A successful request never aborts, so the function stayed on the signal. A new AbortController per request hid this. Reusing one signal (Yoga useExecutionCancellation() plus a stitched buildHTTPExecutor({ fetch: yoga.fetch }) path) left one listener per finished query. Heap snapshots then grew with request count.

    const signal = controller.signal;
    
    await execute({ schema, document, signal });
    await execute({ schema, document, signal });
    // the first request's abort listener is now removed

    Subscriptions still keep the listener until abort, so cancel can close the stream.

  • Updated dependencies [7fbc6e7, 5ceed9d]:

    • @graphql-tools/utils@13.1.3

@graphql-tools/executor-apollo-link@3.0.6

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3

@graphql-tools/executor-envelop@5.0.6

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3

@graphql-tools/executor-legacy-ws@2.0.6

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3

@graphql-tools/executor-urql-exchange@2.0.6

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3

@graphql-tools/executor-yoga@4.0.6

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3
    • @graphql-tools/executor-envelop@5.0.6

@graphql-tools/graphql-tag-pluck@9.0.7

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3

graphql-tools@10.0.6

Patch Changes

  • Updated dependencies [fe44242]:
    • @graphql-tools/schema@11.0.6

@graphql-tools/import@8.0.6

Patch Changes

  • #8577 f5b0a19 Thanks @ardatan! - processImport keeps the AST nodes collected from #import instead of printing every definition to SDL and parsing that string again.

    A type that many other types depend on is stored in each of those sets, so the same node was printed over and over. Two files can also carry identical SDL (for example the same type Query after a field import). Those are still de-duplicated: skip a node already seen, and skip a second node that prints to the same SDL. The first node is kept. Leading comments stay on that node (for example # eslint-disable-next-line above a query).

    const document = processImport('./schema.graphql');
    // document.definitions are the nodes parsed from the imported files
  • Updated dependencies [7fbc6e7, 5ceed9d]:

    • @graphql-tools/utils@13.1.3

@graphql-tools/jest-transform@3.0.1

Patch Changes

  • Updated dependencies [8bbb097]:
    • @graphql-tools/webpack-loader@8.0.1

@graphql-tools/links@11.0.6

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3

@graphql-tools/load@9.0.6

Patch Changes

  • Updated dependencies [7fbc6e7, fe44242, 5ceed9d]:
    • @graphql-tools/utils@13.1.3
    • @graphql-tools/schema@11.0.6

@graphql-tools/load-files@8.0.6

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3

@graphql-tools/apollo-engine-loader@9.0.6

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3

@graphql-tools/code-file-loader@9.0.7

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3
    • @graphql-tools/graphql-tag-pluck@9.0.7
    • @graphql-tools/load-files@8.0.6

@graphql-tools/external-fragment-loader@1.0.7

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3
    • @graphql-tools/graphql-tag-pluck@9.0.7
    • @graphql-tools/load-files@8.0.6

@graphql-tools/git-loader@9.0.7

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3
    • @graphql-tools/graphql-tag-pluck@9.0.7

@graphql-tools/github-loader@10.0.7

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3
    • @graphql-tools/graphql-tag-pluck@9.0.7

@graphql-tools/graphql-file-loader@9.0.6

Patch Changes

  • Updated dependencies [7fbc6e7, f5b0a19, 5ceed9d]:
    • @graphql-tools/utils@13.1.3
    • @graphql-tools/import@8.0.6
    • @graphql-tools/load-files@8.0.6

@graphql-tools/json-file-loader@9.0.6

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3
    • @graphql-tools/load-files@8.0.6

@graphql-tools/module-loader@9.0.6

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3

@graphql-tools/url-loader@10.0.6

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3
    • @graphql-tools/executor-legacy-ws@2.0.6

@graphql-tools/merge@10.0.6

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3

@graphql-tools/node-require@8.0.6

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3
    • @graphql-tools/load@9.0.6
    • @graphql-tools/graphql-file-loader@9.0.6

@graphql-tools/relay-operation-optimizer@8.0.6

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3

@graphql-tools/resolvers-composition@8.0.6

Patch Changes

  • Updated dependencies [7fbc6e7, 5ceed9d]:
    • @graphql-tools/utils@13.1.3

@graphql-tools/schema@11.0.6

Patch Changes

  • #8564 fe44242 Thanks @ardatan! - requireResolversForArgs (and the other resolver-presence checks) now look for subscribe on the schema's subscription type.

    On subscriptions, subscribe is required and resolve is optional. The validator used to look only at field.resolve, so a subscription with arguments was reported as missing even when subscribe was present. Query and mutation fields still require resolve.

  • Updated dependencies [7fbc6e7, 5ceed9d]:

    • @graphql-tools/utils@13.1.3
    • @graphql-tools/merge@10.0.6

@graphql-tools/utils@13.1.3

Patch Changes

  • #8575 7fbc6e7 Thanks @ardatan! - mapSchema now remaps directive argument defaults the same way it already remaps field argument defaults.

    Use case: UserRole is remapped to internal ids, and @auth defaults to USER.

    const schema = mapSchema(originalSchema, {
      [MapperKind.ENUM_VALUE]: (valueConfig, typeName, _schema, externalValue) => {
        if (typeName === 'UserRole' && externalValue === 'USER') {
          return { ...valueConfig, value: '3user' };
        }
        return valueConfig;
      },
    });
    
    // directive @auth(role: UserRole = USER)
    schema.getDirective('auth').args.find(arg => arg.name === 'role').defaultValue;
    // before: "USER"
    // after:  "3user"

    mapSchema serializes the stored default with the source type before parsing with the remapped type, so an internal value that matches another enum name (USER -> "ADMIN") stays "ADMIN" instead of being parsed as that name.

    forEachDefaultValue walks directive arguments too, so makeExecutableSchema enum resolvers get the same result.

  • #8574 5ceed9d Thanks @ardatan! - Published Executor types include /// <reference lib="esnext.disposable" preserve="true" /> so consumers do not need skipLibCheck or a full esnext lib just to import this package.

    Use case: an app with "lib": ["es2022"] or ["es2024"] and skipLibCheck: false that imports @graphql-tools/utils:

    import type { Executor } from '@graphql-tools/utils';
    
    export const executor: Executor = async request => {
      // ...
    };

    Executor can return a Disposable / AsyncIterable result. Those names live in TypeScript's esnext.disposable lib, which is not part of es2022/es2024. Without the preserved reference, tsc reports Cannot find name 'Disposable'. With it, the published .d.ts pulls in that lib for the consumer automatically.

@graphql-tools/webpack-loader@8.0.1

Patch Changes

Don't miss a new graphql-tools release

NewReleases is sending notifications on new releases.