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

Eddy Nguyen
Eddy Nguyen
On this page

typescript-operations and client-preset v6 are now available, introducing a major overhaul of how client types are generated.

  • Significantly less generated code
  • Stronger, more accurate types by default
  • Fewer dependencies and a simpler setup

The main change

Previously, the low-level typescript plugin generated all schema types, and typescript-operations referenced those types for inputs and variables.

This approach caused a few issues:

  • All schema types were generated, even if unused
    Result: large generated files filled with types you never use
  • Client and server plugins were indirectly coupled
    Result: slower iteration, as changes risked breaking other use cases
  • typescript-operations setups were manual and easy to get wrong
    Result: verbose setups and reliance on additional plugins or presets

With v6, typescript-operations and client-preset are redesigned around three key ideas:

  • Generate schema types only when they are actually used, instead of generating the entire schema upfront
  • Fully decouple from typescript and typescript-resolvers
  • Provide better built-in support for common typescript-operations setups: one-file, multi-file, and near-operation-file

Read about the supported typescript-operations setups

Other notable changes

  • Default client-preset persisted document hash algorithm is now SHA-256
  • Improved type correctness and defaults for scalars, @skip/@include, and field nullability
  • Configuration updates: improved avoidOptionals, enumValues, and removal of preResolveTypes
  • CLI errors no longer fail silently
  • Packages are ESM-first

Read the v6 migration guide

Bonus: migrating from Apollo Tooling

GraphQL Codegen now supports migration from Apollo Tooling (apollo client:codegen).

This includes:

  • near-operation-file preset compatibility
  • Enum type compatibility
  • Matching type naming conventions

Existing Apollo Tooling projects can switch with minimal changes.

Read the migration guide from Apollo Tooling

Resources

Explore

Dive deeper into related topics.

GraphQL

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

Eddy Nguyen
GraphQL

Proven Schema Designs and Best Practices - Part 2

Jeff Dolle

Get your API game right.