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

Eddy Nguyen
Eddy Nguyen

GraphQL Codegen typescript-operations and client-preset v6 was released with a hollistic review of dependencies, config options, and plugin interoperability to improve Developer Experience for our users:

  • Less generated code
  • Better type correctness and defaults
  • Fewer dependencies, and simpler setup

What changed?

Previously, the low-level typescript plugin was used to generate all schema types, and the typescript-operations plugin referred to the schema types in its Input and Variables types. This approach led to a few problems:

  • All schema types were generated, even if unused
    • Impact: Unncessarily large generated files and extraneous types, which caused confusion to users.
  • Client and server plugins were indirectly tied together
    • Examples:
      • typescript plugin's default options were created to work for both client and server, but not optimised for either. This meant users must eventually tweaked the default config for their client use case.
      • Any attempt to reduce the generated schema types most likely touch the typescript plugin, which impacted the server plugin typescript-resolvers, because they both relied on the same generated type.
    • Impact: Slower feature turnaround, because contributors working on the client use case needed to tip-toe to avoid impacting the server use case.
  • Ways to setup Codegen config were numerous, with some requiring external plugins/presets with fragile integration

Now, typescript-operations and client-preset v6 were built with fundamental changes to solve the mentioned problems:

  • Generates schema types only when used
  • Fully decoupled from typescript and typescript-resolvers
  • Built-in support for setups commonly used by the community: one-file, multi-file, near-operation-file setups

Other changes - TODO

  • ESM dependencies
  • client-preset's default hash algorithm is SHA256

Explore

Dive deeper into related topics.

GraphQL

Proven Schema Designs and Best Practices - Part 2

Jeff Dolle
GraphQL

Proven Schema Designs and Best Practices - Part 1

Jeff Dolle

Get your API game right.