GraphQL Codegen: Consistent Watcher, a Faster Server Preset, and Fixed Windows Support

Eddy Nguyen
Eddy Nguyen
On this page

Watch mode in GraphQL Code Generator is now consistent across file tracking, profiling, plugins and presets. Server Preset v0.19 builds on that with internal caching to make watch re-runs up to 80% faster, and Windows support is improved too.

Watch mode is consistent now

Watch mode is the recommended way to work with Codegen in managed workflows like Client Preset and Server Preset. But the base CLI’s watch-mode support wasn’t consistent across plugins and presets, and profiling didn’t work on every run.

Recent patch fixed reliability issues, and added improvements allow library authors more flexibility to control the output:

  • overwrite.updateExistingFiles and overwrite.removeStaleFiles let a preset control whether its regenerated files are updated in place or removed as stale
  • overwrite set on a preset-based generates entry now works
  • contentComparison lets plugins and presets choose disk vs. cache comparison when deciding whether to rewrite a file
  • --profile --watch now writes a trace after every rebuild, not just the initial run

Server Preset v0.19: up to 80% faster watch re-runs

With the watcher behaving predictably, we could make Server Preset lean on it. v0.19 uses the new watch capabilities and adds internal caching of its most expensive work: the check that compares resolver types against your mappers, and the schema parsing that every generates block used to repeat.

Measured on Hive Console’s codebase, on re-runs where schema types and mappers don’t change, generation time dropped by up to 80%.

Fixed Windows Support

We want Codegen to work in any environment seamlessly. Windows support has been lacking, mainly due to differences in how Windows handles file paths.

That’s fixed too:

  • Watch mode’s ignore patterns now correctly use forward slashes, so generated output is ignored instead of being watched and re-triggering builds
  • Loading a schema or documents from a .js, .cjs, or .mjs file no longer crashes with an ESM URL-scheme error

Upgrading

pnpm add -D @graphql-codegen/cli@7.4.1 # Watcher and Windows fixes
pnpm add -D @eddeee888/gcg-typescript-resolver-files@0.19.0 # Server Preset perf improvements

If watch mode still feels slow or wrong for you, run it with --profile and open an issue with the trace on graphql-code-generator or graphql-code-generator-plugins.

Explore

Dive deeper into related topics.

GraphQL

GraphQL Codegen Update, April 2026 - Operations and Client Preset v6

Eddy Nguyen
GraphQL

Proven Schema Designs and Best Practices - Part 2

Jeff Dolle

Get your API game right.