Packages

@graphql-tools/mock

10.1.1 · 23 Oct 2026MIT688k / weekRepositoryHomepagenpmAtom feed

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

  1. 10.x · latest line
  2. 10.1.1

    23 Oct 2026
    • dependencies updates:

    • Use fakePromise / fakeRejectPromise for iterator return / throw / asyncDispose instead of unnecessary async

  3. 10.1.0

    22 Oct 2026
    • 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.

    • 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.

    • 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.

  4. 10.0.1 – 10.0.54 releases that only update dependencies@graphql-tools/utils 13.1.2@graphql-tools/schema 11.0.5Show each
  5. 10.0.0

    19 Oct 2026
    • breaking

      Drop GraphQL v14/v15 support and require Node.js >= 22.18.

    • On Node.js ≥26.1 (and ≥24.16 where backported), fs.glob followSymlinks is used.

    • On older engines, symlink directories are discovered only under each pattern’s literal prefix (not the whole cwd) and patterns are re-rooted.

  6. 9.x
  7. 9.1.18

    15 Oct 2026
    • dependencies updates:

  8. 9.1.16 – 9.1.172 releases that only update dependencies@graphql-tools/utils 12.0.4@graphql-tools/schema 10.1.4Show each
  9. 9.1.15

    30 Sep 2026
    • security

      Fix prototype pollution in mergeIncrementalResult

      Path segments are now rejected unless they are primitive strings or numbers, and keys named __proto__, constructor or prototype are still blocked. Previously a non-primitive segment such as ["__proto__"] bypassed the string equality guard and was coerced into a write on Object.prototype.

      Also exports shared isSafeObjectKey / isDangerousObjectKey helpers used by this path walker and other package call sites. @graphql-tools/merge and @graphql-tools/mock are patched so they ship with the new imports; updateInternalDependencies raises their utils floor when 12.0.2 is versioned.

  10. 9.1.14

    7 Sep 2026
    • Pass resolverValidationOptions through from addMocksToSchema to addResolversToSchema.

  11. 9.1.12

    17 Jul 2026

    Reading the note…

  12. 9.1.11

    17 Jul 2026

    Reading the note…

  13. 9.1.10

    8 Jul 2026

    Reading the note…

  14. 9.1.9

    6 Jul 2026

    Reading the note…

  15. 9.1.8

    28 Jun 2026

    Reading the note…

  16. 9.1.7

    23 Apr 2026

    Reading the note…

  17. 9.1.6

    9 Apr 2026

    Reading the note…

  18. 9.1.5

    7 Jan 2026

    Reading the note…

  19. 9.1.4

    28 Nov 2025

    Reading the note…

  20. 9.1.3

    12 Nov 2025

    Reading the note…

  21. 9.1.2

    11 Nov 2025

    Reading the note…

  22. 9.1.1

    4 Nov 2025

    Reading the note…

  23. 9.1.0

    30 Oct 2025

    Reading the note…

  24. 9.0.25

    21 Jul 2025

    Reading the note…

  25. 9.0.24

    17 Jul 2025

    Reading the note…

  26. 9.0.23

    22 May 2025

    Reading the note…

  27. 9.0.22

    13 Mar 2025

    Reading the note…

  28. 9.0.21

    13 Mar 2025

    Reading the note…

  29. 9.0.20

    3 Mar 2025

    Reading the note…

  30. 9.0.19

    25 Feb 2025

    Reading the note…

  31. 9.0.18

    21 Feb 2025

    Reading the note…

  32. 9.0.17

    10 Feb 2025

    Reading the note…

  33. 9.0.16

    10 Feb 2025

    Reading the note…

  34. 9.0.15

    16 Jan 2025

    Reading the note…

  35. 9.0.14

    6 Jan 2025

    Reading the note…

  36. 9.0.13

    2 Jan 2025

    Reading the note…

  37. 9.0.12

    24 Dec 2024

    Reading the note…

  38. 9.0.11

    14 Dec 2024

    Reading the note…

  39. 9.0.10

    13 Dec 2024

    Reading the note…

  40. 9.0.9

    4 Dec 2024

    Reading the note…

  41. 9.0.8

    27 Nov 2024

    Reading the note…

  42. 9.0.7

    22 Nov 2024

    Reading the note…

  43. 9.0.6

    13 Nov 2024

    Reading the note…

  44. 9.0.5

    15 Oct 2024

    Reading the note…

  45. 9.0.4

    23 Jul 2024

    Reading the note…

  46. 9.0.3

    27 May 2024

    Reading the note…

  47. 9.0.2

    23 Feb 2024

    Reading the note…