We’re excited to announce that the Client Preset SWC plugin is now officially part of the swc-project/plugins repo - maintained and supported by the SWC team!

To use the new package, simply install it:

npm i -D @swc-contrib/plugin-graphql-codegen-client-preset

Then, use it in place of the old package:

// next.config.js const nextConfig = { // ... experimental: { swcPlugins: [ [ '@swc-contrib/plugin-graphql-codegen-client-preset', { artifactDirectory: './src/gql', gqlTagName: 'graphql' } ] ] } }

For other use cases, check the updated documentation!

This plugin has been an essential part to reduce bundle size when integrating Client Preset into frameworks with SWC, such as Next.js and Vite. However, SWC plugins are currently not backwards compatible which means every time there was a new release in the swc_core package, @graphql-codegen/client-preset-swc-plugin version needed to be updated.

We created an issue to gather thoughts from the community on how to move forward with (1) guaranteed stability of the package and (2) minimal involvement from Codegen maintainers. Almost immediately, @kdy1dev (Donny, the creator of SWC) made the suggestion to move the project to swc-project/plugins, which solved all the problems!

Needless to say, this is a great solution for the community. Again, big shoutout to Donny for supporting us!

Last updated on