github dotansimha/graphql-code-generator release-1794036720667
November 07, 2026

one hour ago

@graphql-codegen/cli@8.0.0

Major Changes

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: GraphQL 14 and 15 are no
    longer supported. The graphql peer dependency is now ^16.0.0 || ^17.0.0, so upgrade graphql
    to version 16 or 17 before updating to this version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Node.js versions below
    22.18.0 are no longer supported. Upgrade to Node.js 22.18.0 or later before updating to this
    version.

  • #11075
    fa49a37
    Thanks @eddeee888! - generate() now returns
    Promise<FileOutput[] | void> instead of Promise<FileOutput[] | any>. The result is no longer
    any, so consumers using the result as an array must narrow it first.

    Refs #11071

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Remove the deprecated
    emitLegacyCommonJSImports config option and the --emit-legacy-common-js-imports CLI flag

    Use importExtension (or --import-extension) to set the extension appended to relative imports.
    When importExtension is not set, no extension is appended.

    @graphql-codegen/plugin-helpers no longer exports normalizeImportExtension. Use
    importExtension ?? '' instead.

    Migration:

     const config: CodegenConfig = {
    -  emitLegacyCommonJSImports: false,
    +  importExtension: '.js',
     };
  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: @graphql-tools/*
    dependencies are updated to their latest majors, which require Node.js 22.18.0 or later and
    GraphQL 16 or 17. If you import @graphql-tools/* packages in your own code, update them to the
    same majors to avoid duplicate installs. @graphql-tools/code-file-loader@9 now extracts
    #graphql-marked template literals by default, so code files that contain such templates can
    produce newly found documents; check your generated output after upgrading. To keep the previous
    behavior, set pluckConfig: { gqlHashComment: '' }.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE - config.generates no
    longer takes ConfiguredPlugin[], takes ConfiguredOutput[] instead

    config.generates's previous typing allowed a value to be an array e.g.

    generates: {
      "src/gql/generated.ts": [{ typescript: {} }]
    }
    

    However, this never worked because this config is eventually passed into normalizeOutputParam
    which previously had this bug in the implementation:

    export function normalizeOutputParam(config) {
      // 0. When config is an array...
      if (isOutputConfigArray(config)) {
        // 1. `isOutputConfigArray(config)` was `Array.isArray(config)` -> returns true
        return {
          documents: [],
          schema: [],
          plugins: isConfiguredOutput(config) ? config.plugins : config // 2. ‼️ `isConfiguredOutput(config)` was `typeof config === 'object'` -> returns true. This is a bug because we are accessing `plugins` property of an array, which will ALWAYS be `undefined` -> the output is always rejected as "Invalid Codegen Configuration"
        }
      }
      if (isConfiguredOutput(config)) {
        return config
      }
      throw new Error(`Invalid "generates" config!`)
    }

    Now, an array is still accepted, but as ConfiguredOutput[] instead. For this major version
    release, only the first array element is used, and @graphql-codegen/cli logs a warning when
    there is more than one element.

    normalizeOutputParam now returns ConfiguredOutput[] instead of a single ConfiguredOutput.

    @graphql-codegen/cli also throws its "Invalid Codegen Configuration" error when a generates
    array is empty or its first element is not a config object. This error is now a single generic
    message, no longer naming the output file, and it shows a TypeScript CodegenConfig example with
    the ConfiguredOutput shape instead of the old YAML plugin-list example.

Patch Changes

@graphql-codegen/core@7.0.0

Major Changes

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: GraphQL 14 and 15 are no
    longer supported. The graphql peer dependency is now ^16.0.0 || ^17.0.0, so upgrade graphql
    to version 16 or 17 before updating to this version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Node.js versions below
    22.18.0 are no longer supported. Upgrade to Node.js 22.18.0 or later before updating to this
    version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: A plugin's validate
    function now receives an info object as its fourth argument, matching the plugin function:
    validate(schema, documents, config, { outputFile, allPlugins, pluginContext }). Custom plugins
    that export validate and read outputFile, allPlugins or pluginContext as positional
    arguments must destructure them from the fourth argument instead.

    Refs #11071

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: @graphql-tools/*
    dependencies are updated to their latest majors, which require Node.js 22.18.0 or later and
    GraphQL 16 or 17. If you import @graphql-tools/* packages in your own code, update them to the
    same majors to avoid duplicate installs. @graphql-tools/code-file-loader@9 now extracts
    #graphql-marked template literals by default, so code files that contain such templates can
    produce newly found documents; check your generated output after upgrading. To keep the previous
    behavior, set pluckConfig: { gqlHashComment: '' }.

Patch Changes

@graphql-codegen/add@8.0.0

Major Changes

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: GraphQL 14 and 15 are no
    longer supported. The graphql peer dependency is now ^16.0.0 || ^17.0.0, so upgrade graphql
    to version 16 or 17 before updating to this version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Node.js versions below
    22.18.0 are no longer supported. Upgrade to Node.js 22.18.0 or later before updating to this
    version.

Patch Changes

@graphql-codegen/fragment-matcher@8.0.0

Major Changes

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: GraphQL 14 and 15 are no
    longer supported. The graphql peer dependency is now ^16.0.0 || ^17.0.0, so upgrade graphql
    to version 16 or 17 before updating to this version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Node.js versions below
    22.18.0 are no longer supported. Upgrade to Node.js 22.18.0 or later before updating to this
    version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: A plugin's validate
    function now receives an info object as its fourth argument, matching the plugin function:
    validate(schema, documents, config, { outputFile, allPlugins, pluginContext }). Custom plugins
    that export validate and read outputFile, allPlugins or pluginContext as positional
    arguments must destructure them from the fourth argument instead.

    Refs #11071

Patch Changes

@graphql-codegen/introspection@7.0.0

Major Changes

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: GraphQL 14 and 15 are no
    longer supported. The graphql peer dependency is now ^16.0.0 || ^17.0.0, so upgrade graphql
    to version 16 or 17 before updating to this version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Node.js versions below
    22.18.0 are no longer supported. Upgrade to Node.js 22.18.0 or later before updating to this
    version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: A plugin's validate
    function now receives an info object as its fourth argument, matching the plugin function:
    validate(schema, documents, config, { outputFile, allPlugins, pluginContext }). Custom plugins
    that export validate and read outputFile, allPlugins or pluginContext as positional
    arguments must destructure them from the fourth argument instead.

    Refs #11071

Patch Changes

@graphql-codegen/schema-ast@7.0.0

Major Changes

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: GraphQL 14 and 15 are no
    longer supported. The graphql peer dependency is now ^16.0.0 || ^17.0.0, so upgrade graphql
    to version 16 or 17 before updating to this version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Node.js versions below
    22.18.0 are no longer supported. Upgrade to Node.js 22.18.0 or later before updating to this
    version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: A plugin's validate
    function now receives an info object as its fourth argument, matching the plugin function:
    validate(schema, documents, config, { outputFile, allPlugins, pluginContext }). Custom plugins
    that export validate and read outputFile, allPlugins or pluginContext as positional
    arguments must destructure them from the fourth argument instead.

    Refs #11071

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Remove the
    commentDescriptions option from SchemaASTConfig. It has had no effect since graphql 16, which
    no longer prints descriptions as comments. Delete it from your schema-ast config; the generated
    output does not change.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: @graphql-tools/*
    dependencies are updated to their latest majors, which require Node.js 22.18.0 or later and
    GraphQL 16 or 17. If you import @graphql-tools/* packages in your own code, update them to the
    same majors to avoid duplicate installs. @graphql-tools/code-file-loader@9 now extracts
    #graphql-marked template literals by default, so code files that contain such templates can
    produce newly found documents; check your generated output after upgrading. To keep the previous
    behavior, set pluckConfig: { gqlHashComment: '' }.

Patch Changes

@graphql-codegen/time@8.0.0

Major Changes

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: GraphQL 14 and 15 are no
    longer supported. The graphql peer dependency is now ^16.0.0 || ^17.0.0, so upgrade graphql
    to version 16 or 17 before updating to this version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Node.js versions below
    22.18.0 are no longer supported. Upgrade to Node.js 22.18.0 or later before updating to this
    version.

Patch Changes

@graphql-codegen/visitor-plugin-common@8.0.0

Major Changes

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: GraphQL 14 and 15 are no
    longer supported. The graphql peer dependency is now ^16.0.0 || ^17.0.0, so upgrade graphql
    to version 16 or 17 before updating to this version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Node.js versions below
    22.18.0 are no longer supported. Upgrade to Node.js 22.18.0 or later before updating to this
    version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Remove the deprecated
    emitLegacyCommonJSImports config option and the --emit-legacy-common-js-imports CLI flag

    Use importExtension (or --import-extension) to set the extension appended to relative imports.
    When importExtension is not set, no extension is appended.

    @graphql-codegen/plugin-helpers no longer exports normalizeImportExtension. Use
    importExtension ?? '' instead.

    Migration:

     const config: CodegenConfig = {
    -  emitLegacyCommonJSImports: false,
    +  importExtension: '.js',
     };
  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: @graphql-tools/*
    dependencies are updated to their latest majors, which require Node.js 22.18.0 or later and
    GraphQL 16 or 17. If you import @graphql-tools/* packages in your own code, update them to the
    same majors to avoid duplicate installs. @graphql-tools/code-file-loader@9 now extracts
    #graphql-marked template literals by default, so code files that contain such templates can
    produce newly found documents; check your generated output after upgrading. To keep the previous
    behavior, set pluckConfig: { gqlHashComment: '' }.

Minor Changes

  • #11103
    409ffbf
    Thanks @jerelmiller! - Add support for graphql v17 fragment
    arguments (experimentalFragmentArguments).

    To use fragment arguments, set the parser option in the root config:

    const config: CodegenConfig = {
      config: { experimentalFragmentArguments: true }
      // ...
    }

Patch Changes

@graphql-codegen/typescript-document-nodes@7.0.0

Major Changes

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: GraphQL 14 and 15 are no
    longer supported. The graphql peer dependency is now ^16.0.0 || ^17.0.0, so upgrade graphql
    to version 16 or 17 before updating to this version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Node.js versions below
    22.18.0 are no longer supported. Upgrade to Node.js 22.18.0 or later before updating to this
    version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: A plugin's validate
    function now receives an info object as its fourth argument, matching the plugin function:
    validate(schema, documents, config, { outputFile, allPlugins, pluginContext }). Custom plugins
    that export validate and read outputFile, allPlugins or pluginContext as positional
    arguments must destructure them from the fourth argument instead.

    Refs #11071

Patch Changes

@graphql-codegen/gql-tag-operations@7.0.0

Major Changes

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: GraphQL 14 and 15 are no
    longer supported. The graphql peer dependency is now ^16.0.0 || ^17.0.0, so upgrade graphql
    to version 16 or 17 before updating to this version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Node.js versions below
    22.18.0 are no longer supported. Upgrade to Node.js 22.18.0 or later before updating to this
    version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Remove the deprecated
    emitLegacyCommonJSImports config option and the --emit-legacy-common-js-imports CLI flag

    Use importExtension (or --import-extension) to set the extension appended to relative imports.
    When importExtension is not set, no extension is appended.

    @graphql-codegen/plugin-helpers no longer exports normalizeImportExtension. Use
    importExtension ?? '' instead.

    Migration:

     const config: CodegenConfig = {
    -  emitLegacyCommonJSImports: false,
    +  importExtension: '.js',
     };
  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: @graphql-tools/*
    dependencies are updated to their latest majors, which require Node.js 22.18.0 or later and
    GraphQL 16 or 17. If you import @graphql-tools/* packages in your own code, update them to the
    same majors to avoid duplicate installs. @graphql-tools/code-file-loader@9 now extracts
    #graphql-marked template literals by default, so code files that contain such templates can
    produce newly found documents; check your generated output after upgrading. To keep the previous
    behavior, set pluckConfig: { gqlHashComment: '' }.

Patch Changes

@graphql-codegen/typescript-operations@7.0.0

Major Changes

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: GraphQL 14 and 15 are no
    longer supported. The graphql peer dependency is now ^16.0.0 || ^17.0.0, so upgrade graphql
    to version 16 or 17 before updating to this version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Node.js versions below
    22.18.0 are no longer supported. Upgrade to Node.js 22.18.0 or later before updating to this
    version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Remove the deprecated
    emitLegacyCommonJSImports config option and the --emit-legacy-common-js-imports CLI flag

    Use importExtension (or --import-extension) to set the extension appended to relative imports.
    When importExtension is not set, no extension is appended.

    @graphql-codegen/plugin-helpers no longer exports normalizeImportExtension. Use
    importExtension ?? '' instead.

    Migration:

     const config: CodegenConfig = {
    -  emitLegacyCommonJSImports: false,
    +  importExtension: '.js',
     };

Minor Changes

  • #11103
    409ffbf
    Thanks @jerelmiller! - Add support for graphql v17 fragment
    arguments (experimentalFragmentArguments).

    To use fragment arguments, set the parser option in the root config:

    const config: CodegenConfig = {
      config: { experimentalFragmentArguments: true }
      // ...
    }

Patch Changes

@graphql-codegen/typescript-resolvers@7.0.0

Major Changes

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: GraphQL 14 and 15 are no
    longer supported. The graphql peer dependency is now ^16.0.0 || ^17.0.0, so upgrade graphql
    to version 16 or 17 before updating to this version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Node.js versions below
    22.18.0 are no longer supported. Upgrade to Node.js 22.18.0 or later before updating to this
    version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: @graphql-tools/*
    dependencies are updated to their latest majors, which require Node.js 22.18.0 or later and
    GraphQL 16 or 17. If you import @graphql-tools/* packages in your own code, update them to the
    same majors to avoid duplicate installs. @graphql-tools/code-file-loader@9 now extracts
    #graphql-marked template literals by default, so code files that contain such templates can
    produce newly found documents; check your generated output after upgrading. To keep the previous
    behavior, set pluckConfig: { gqlHashComment: '' }.

Patch Changes

@graphql-codegen/typed-document-node@8.0.0

Major Changes

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: GraphQL 14 and 15 are no
    longer supported. The graphql peer dependency is now ^16.0.0 || ^17.0.0, so upgrade graphql
    to version 16 or 17 before updating to this version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Node.js versions below
    22.18.0 are no longer supported. Upgrade to Node.js 22.18.0 or later before updating to this
    version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: A plugin's validate
    function now receives an info object as its fourth argument, matching the plugin function:
    validate(schema, documents, config, { outputFile, allPlugins, pluginContext }). Custom plugins
    that export validate and read outputFile, allPlugins or pluginContext as positional
    arguments must destructure them from the fourth argument instead.

    Refs #11071

Minor Changes

  • #11103
    409ffbf
    Thanks @jerelmiller! - Add support for graphql v17 fragment
    arguments (experimentalFragmentArguments).

    To use fragment arguments, set the parser option in the root config:

    const config: CodegenConfig = {
      config: { experimentalFragmentArguments: true }
      // ...
    }

Patch Changes

@graphql-codegen/typescript@7.0.0

Major Changes

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: GraphQL 14 and 15 are no
    longer supported. The graphql peer dependency is now ^16.0.0 || ^17.0.0, so upgrade graphql
    to version 16 or 17 before updating to this version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Node.js versions below
    22.18.0 are no longer supported. Upgrade to Node.js 22.18.0 or later before updating to this
    version.

Patch Changes

@graphql-codegen/client-preset@7.0.0

Major Changes

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: GraphQL 14 and 15 are no
    longer supported. The graphql peer dependency is now ^16.0.0 || ^17.0.0, so upgrade graphql
    to version 16 or 17 before updating to this version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Node.js versions below
    22.18.0 are no longer supported. Upgrade to Node.js 22.18.0 or later before updating to this
    version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Remove the deprecated
    emitLegacyCommonJSImports config option and the --emit-legacy-common-js-imports CLI flag

    Use importExtension (or --import-extension) to set the extension appended to relative imports.
    When importExtension is not set, no extension is appended.

    @graphql-codegen/plugin-helpers no longer exports normalizeImportExtension. Use
    importExtension ?? '' instead.

    Migration:

     const config: CodegenConfig = {
    -  emitLegacyCommonJSImports: false,
    +  importExtension: '.js',
     };
  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: @graphql-tools/*
    dependencies are updated to their latest majors, which require Node.js 22.18.0 or later and
    GraphQL 16 or 17. If you import @graphql-tools/* packages in your own code, update them to the
    same majors to avoid duplicate installs. @graphql-tools/code-file-loader@9 now extracts
    #graphql-marked template literals by default, so code files that contain such templates can
    produce newly found documents; check your generated output after upgrading. To keep the previous
    behavior, set pluckConfig: { gqlHashComment: '' }.

Minor Changes

  • #11103
    409ffbf
    Thanks @jerelmiller! - Add support for graphql v17 fragment
    arguments (experimentalFragmentArguments).

    To use fragment arguments, set the parser option in the root config:

    const config: CodegenConfig = {
      config: { experimentalFragmentArguments: true }
      // ...
    }

Patch Changes

@graphql-codegen/graphql-modules-preset@7.0.0

Major Changes

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: GraphQL 14 and 15 are no
    longer supported. The graphql peer dependency is now ^16.0.0 || ^17.0.0, so upgrade graphql
    to version 16 or 17 before updating to this version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Node.js versions below
    22.18.0 are no longer supported. Upgrade to Node.js 22.18.0 or later before updating to this
    version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Remove the deprecated
    emitLegacyCommonJSImports config option and the --emit-legacy-common-js-imports CLI flag

    Use importExtension (or --import-extension) to set the extension appended to relative imports.
    When importExtension is not set, no extension is appended.

    @graphql-codegen/plugin-helpers no longer exports normalizeImportExtension. Use
    importExtension ?? '' instead.

    Migration:

     const config: CodegenConfig = {
    -  emitLegacyCommonJSImports: false,
    +  importExtension: '.js',
     };
  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: @graphql-tools/*
    dependencies are updated to their latest majors, which require Node.js 22.18.0 or later and
    GraphQL 16 or 17. If you import @graphql-tools/* packages in your own code, update them to the
    same majors to avoid duplicate installs. @graphql-tools/code-file-loader@9 now extracts
    #graphql-marked template literals by default, so code files that contain such templates can
    produce newly found documents; check your generated output after upgrading. To keep the previous
    behavior, set pluckConfig: { gqlHashComment: '' }.

Patch Changes

@graphql-codegen/testing@6.0.0

Major Changes

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Node.js versions below
    22.18.0 are no longer supported. Upgrade to Node.js 22.18.0 or later before updating to this
    version.

Patch Changes

@graphql-codegen/plugin-helpers@8.0.0

Major Changes

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: GraphQL 14 and 15 are no
    longer supported. The graphql peer dependency is now ^16.0.0 || ^17.0.0, so upgrade graphql
    to version 16 or 17 before updating to this version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Node.js versions below
    22.18.0 are no longer supported. Upgrade to Node.js 22.18.0 or later before updating to this
    version.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: A plugin's validate
    function now receives an info object as its fourth argument, matching the plugin function:
    validate(schema, documents, config, { outputFile, allPlugins, pluginContext }). Custom plugins
    that export validate and read outputFile, allPlugins or pluginContext as positional
    arguments must destructure them from the fourth argument instead.

    Refs #11071

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE - Remove
    isOutputConfigArray and isConfiguredOutput

    These functions were only used internally, and wrappers of simple functions.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: Remove the deprecated
    emitLegacyCommonJSImports config option and the --emit-legacy-common-js-imports CLI flag

    Use importExtension (or --import-extension) to set the extension appended to relative imports.
    When importExtension is not set, no extension is appended.

    @graphql-codegen/plugin-helpers no longer exports normalizeImportExtension. Use
    importExtension ?? '' instead.

    Migration:

     const config: CodegenConfig = {
    -  emitLegacyCommonJSImports: false,
    +  importExtension: '.js',
     };
  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE: @graphql-tools/*
    dependencies are updated to their latest majors, which require Node.js 22.18.0 or later and
    GraphQL 16 or 17. If you import @graphql-tools/* packages in your own code, update them to the
    same majors to avoid duplicate installs. @graphql-tools/code-file-loader@9 now extracts
    #graphql-marked template literals by default, so code files that contain such templates can
    produce newly found documents; check your generated output after upgrading. To keep the previous
    behavior, set pluckConfig: { gqlHashComment: '' }.

  • #11075
    fa49a37
    Thanks @eddeee888! - BREAKING CHANGE - config.generates no
    longer takes ConfiguredPlugin[], takes ConfiguredOutput[] instead

    config.generates's previous typing allowed a value to be an array e.g.

    generates: {
      "src/gql/generated.ts": [{ typescript: {} }]
    }
    

    However, this never worked because this config is eventually passed into normalizeOutputParam
    which previously had this bug in the implementation:

    export function normalizeOutputParam(config) {
      // 0. When config is an array...
      if (isOutputConfigArray(config)) {
        // 1. `isOutputConfigArray(config)` was `Array.isArray(config)` -> returns true
        return {
          documents: [],
          schema: [],
          plugins: isConfiguredOutput(config) ? config.plugins : config // 2. ‼️ `isConfiguredOutput(config)` was `typeof config === 'object'` -> returns true. This is a bug because we are accessing `plugins` property of an array, which will ALWAYS be `undefined` -> the output is always rejected as "Invalid Codegen Configuration"
        }
      }
      if (isConfiguredOutput(config)) {
        return config
      }
      throw new Error(`Invalid "generates" config!`)
    }

    Now, an array is still accepted, but as ConfiguredOutput[] instead. For this major version
    release, only the first array element is used, and @graphql-codegen/cli logs a warning when
    there is more than one element.

    normalizeOutputParam now returns ConfiguredOutput[] instead of a single ConfiguredOutput.

    @graphql-codegen/cli also throws its "Invalid Codegen Configuration" error when a generates
    array is empty or its first element is not a config object. This error is now a single generic
    message, no longer naming the output file, and it shows a TypeScript CodegenConfig example with
    the ConfiguredOutput shape instead of the old YAML plugin-list example.

Patch Changes

Don't miss a new graphql-code-generator release

NewReleases is sending notifications on new releases.