started · updated
GraphQL Codegen introduces optimizations for Apollo Client and SWC
New updates and optimizations have been introduced for GraphQL development workflows, specifically focusing on Apollo Client and GraphQL Codegen.
To address bundle size bloat caused by the client-preset in GraphQL Codegen, a new @graphql-codegen/client-preset-swc-plugin has been released. This plugin is designed for applications using the SWC compiler, such as those built with Next.js or Vite. It aims to improve code-splitting and tree-shaking, which are often difficult when using the standard graphql function that requires all operations to be available for parsing.
Additionally, GraphQL Codegen has updated its fragment-matcher plugin to support Apollo Client v3. The update automates the generation of the possibleTypes object required by the Apollo Client cache, reducing the need for manual maintenance and preventing potential runtime errors. These improvements follow large-scale migrations from Apollo Client 2 to version 3.
Entities
Apollo Client · GraphQL Codegen · Hive · SWC