# What changed in @graphql-codegen/cli

> 27 changes in @graphql-codegen/cli 7 from its official release notes, upgrade guides and advisories: 1 breaking, 1 security, 3 new APIs and options. Each one cited. Sources checked 2026-10-22. HTML: https://unstale.sh/npm/@graphql-codegen/cli/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## @graphql-codegen/cli 7

### Breaking changes

- An unresolved output preset now counts toward the run's failure state, so the default `allowPartialOutputs: false` takes effect and the CLI no longer reports success. (7.4.2) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#742)

### Security

- Updates to v12 and related dependencies to pick up the fix for prototype pollution in mergeDeep. (7.4.5) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#745)

### New APIs and options

- Adds a watch-mode option to compare generated content against the on-disk file or the in-memory cache; preset values take precedence, and the default is cache-first. (7.4.0) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#740)
- Configure whether stale files are removed, allowing granular control over overwrite actions. (7.3.0) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#730)
- Configure whether existing files are updated, allowing granular control over overwrite actions. (7.3.0) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#730)

### Behavior and default changes

- The CLI option's default is now typed never[] instead of any[]. (7.4.6) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#746)
- Its return type is now Types.Config without an argument and T & Types.Config when extraConfig is provided. (7.4.4) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#744)
- With `--profile --watch`, a fresh trace file is now written after the initial run and each rebuild; failed rebuilds produce no trace and their events are discarded. (7.3.1) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#731)

### Tooling

- The supported peer dependency range now includes GraphQL 17. (7.2.0) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#720)

### Fixes and other changes

- The emitted return type is now Promise<string | undefined>. (7.4.6) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#746)
- The CLI unwraps AggregateError so syntax errors continue to print the native GraphQLError with its file location. (7.4.5) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#745)
- The property is now typed as string[]. (7.4.4) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#744)
- The filepath property is now optional, matching contexts without a filepath. (7.4.4) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#744)
- Its return type now includes null, matching the result when no config file is found. (7.4.4) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#744)
- The per-entry schema loader type now accepts a CustomSchemaLoaderFn as well as a path string, so imported loader functions no longer require a cast. (7.4.4) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#744)
- The function now accepts null and undefined and returns an empty array for them. (7.4.4) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#744)
- The function now accepts null and undefined and returns an empty array for them. (7.4.4) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#744)
- Function loaders are keyed by object identity, so different loader functions for the same pointer load separate schemas while a reused function loads once. (7.4.4) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#744)
- The type now includes the kebab-case flags that the CLI reads. (7.4.4) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#744)
- The CLI --help config now includes --check. (7.4.3) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#743)
- Dynamically loaded plugins and presets in ESM builds are resolved relative to the consuming project, and resolved paths are converted to file URLs for import, fixing loading failures including on Windows. (7.4.2) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#742)
- Hook arguments are quoted per platform, preventing Windows scripts from receiving literal quote characters in file paths. (7.4.2) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#742)
- Uses forward-slash separators in generated ignore globs so `@parcel/watcher` ignores generated output files on Windows. (7.4.1) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#741)
- Fixes loading schemas, documents, and modules from absolute Windows paths when using the code-file loader. (7.4.1) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#741)
- Fixes preset-based generates outputs so their overwrite setting is honored, preventing generated files from being deleted as stale when configured not to remove them. (7.4.0) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#740)
- Reads every named project before the default project so codegen projects are detected even when the default project has no codegen extension. (7.1.3) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#713)
- Fixes the CLI's require flag when resolving modules in ESM on native Windows. (7.1.2) — [release notes](https://github.com/dotansimha/graphql-code-generator/blob/68a2ef2586b969470993116846628d6075d2f19b/packages/graphql-codegen-cli/CHANGELOG.md#712)
