Packages

@graphql-tools/import

8.0.9 · 10 Nov 2026MIT13.6M / weekRepositoryHomepagenpmAtom feed

Your version

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

  1. 8.x · latest line
  2. 8.0.7 – 8.0.93 releases that only update dependencies@graphql-tools/utils 13.2.2Show each
  3. 8.0.6

    22 Oct 2026
    • 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
  4. 8.0.0 – 8.0.56 releases with no change for you5 dependency updates, 1 without a note@graphql-tools/utils 13.1.2Show each
  5. 7.x
  6. 7.2.4

    15 Oct 2026
    • Dependencies updates:

  7. 7.2.1 – 7.2.33 releases that only update dependencies@graphql-tools/utils 12.0.4Show each
  8. 7.2.0

    7 Sep 2026
    • # import paths may use a require: prefix, resolved with Node's require.resolve from the importing file. Example: # import Post from "require:blog-graphql-types/schema.graphql" or # import A from "require:./a.graphql".

    • # import "./file.graphql" (space after #) is a valid default import, and #import is processed even when it is not the first non-blank line of the file.

    • Keep leading GraphQL comments (for example # eslint-disable-next-line above a query) when #import merges documents. Previously processImport reprinted definitions and dropped those comments from the merged source.

  9. 7.1.19

    12 Aug 2026
    • #8259
      85f1de0
      Thanks @lemonmade! - perf(import): remove redundant work in
      addDefinition's dependency traversal

      addDefinition recurses across the whole dependency graph while assembling each definition's
      imported dependencies. Two things were repeated on every call:

      Pure performance change; output is unchanged (the existing import tests pass and a real-world
      ~12k-line schema produces byte-identical results). Building on the print memoization, this took
      the same codegen pass from ~17s to ~13s. The remaining cost is the O(n²) shape of the closure
      traversal itself (each definition's transitive set is still rebuilt independently); reducing that
      is left for a follow-up as it's a more invasive change.

    • #8258
      6bacf57
      Thanks @lemonmade! - perf(import): memoize print per node when
      assembling imported definitions

      processImport de-duplicates the collected definitions by printing each one to SDL and comparing
      the strings. A single definition node appears in many of the dependency sets (any
      widely-referenced type is pulled in by every definition that depends on it), so print was called
      roughly O(n²) times for n unique nodes. For large, densely-connected schemas this print/visit work
      dominates import time.

      Memoizing print by node identity makes each unique node print at most once. print is a pure
      function of its node, so the output is identical; this is a pure performance change. On a
      ~12k-line schema imported across three projects, this reduced a downstream codegen pass from ~133s
      to ~17s.

  10. 7.1.13 – 7.1.186 releases that only update dependencies@graphql-tools/utils 11.2.2Show each
  11. 7.1.12

    6 Mar 2026
  12. 7.1.11

    5 Mar 2026
  13. 7.1.10

    22 Jan 2026
  14. 7.1.9

    7 Jan 2026
  15. 7.1.8

    28 Nov 2025
  16. 7.1.7

    21 Nov 2025
  17. 7.1.4 – 7.1.63 releases that only update dependencies@graphql-tools/utils 10.10.3Show each
  18. 7.1.3

    30 Oct 2025
  19. 7.1.2

    22 Sep 2025
  20. 7.1.1

    5 Sep 2025
    • #7433
      07124d5
      Thanks @HunterLarco! - Fix support for absolute path aliases in
      GraphQL imports

      Path aliases configured with absolute paths (e.g., /* → src/*) now work correctly alongside
      relative aliases (e.g., @/* → src/*). This allows more flexible aliasing configurations when
      using tsconfig.json#paths syntax for GraphQL
      imports.

    • #7437
      211ef44
      Thanks @HunterLarco! - enhance GraphQL schema import error
      debugging with source locations

  21. 7.1.0

    26 Aug 2025
    • #7310
      692cfeb
      Thanks @HunterLarco! - GraphQL schemas in large projects,
      especially monorepos, suffer from fragile and verbose relative import paths that become difficult
      to maintain as projects grow. This change brings TypeScript's popular
      tsconfig.json#paths aliasing syntax to GraphQL
      imports, enabling clean, maintainable import statements across your GraphQL schema files.

      Before - Brittle relative imports:

      #import "../../../shared/models/User.graphql"
      #import "../../../../common/types/Product.graphql"

      After - Clean, semantic aliases:

      #import "@models/User.graphql"
      #import "@types/Product.graphql"

      Configuration Example

      {
        mappings: {
          '@models/*': path.join(__dirname, './models/*'),
          '@types/*': path.join(__dirname, './shared/types/*'),
        }
      }

      This change is introduced in a backwards compatible way to ensure no existing use cases are broken
      while using familiar patterns to typescript developers for structuring import aliases.

  22. 7.0.21

    21 Jul 2025

    Only updates a dependency:@graphql-tools/utils 10.9.1

  23. 7.0.20

    17 Jul 2025
  24. 7.0.19

    27 May 2025
    • #7225
      99e6faf
      Thanks @jdolle! - Support 'extend schema' syntax and add 'link' to
      the list of builtins so that it doesnt need a directive definition for federated schemas

  25. 7.0.10 – 7.0.189 releases that only update dependencies@graphql-tools/utils 10.8.6Show each
  26. 7.0.9

    24 Dec 2024
    • #6796
      ddfef2c
      Thanks @ardatan! - Avoid importing process and use it from
      globalThis. In some cases, cwd is not exported with this name in the environment in ESM scope.

  27. 7.0.7 – 7.0.82 releases that only update dependencies@graphql-tools/utils 10.6.4Show each

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.