From d2f8d9b7573d89a7ca4bee566d13e7424bc70bbb Mon Sep 17 00:00:00 2001 From: Eddy Nguyen Date: Sat, 26 Jul 2025 00:21:21 +1000 Subject: [PATCH] Update doc references to swc-plugin (#10383) --- .../pages/plugins/presets/preset-client.mdx | 24 ++++--------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/website/src/pages/plugins/presets/preset-client.mdx b/website/src/pages/plugins/presets/preset-client.mdx index 0e9ed196ce0..fe3951e2962 100644 --- a/website/src/pages/plugins/presets/preset-client.mdx +++ b/website/src/pages/plugins/presets/preset-client.mdx @@ -617,26 +617,10 @@ module.exports = { ### SWC Plugin - - As of 2023/03/11, SWC's custom plugins is still an experimental feature, that means unexpected breaking changes that - makes specific nextjs versions or our plugin incompatible are possible, so please file an issue - [here](https://github.com/dotansimha/graphql-code-generator/issues/new?assignees=&labels=&template=bug_report.yml&title=@graphql-codegen/client-preset-swc-plugin%20...) - if you faced any unexpected behavior/errors while using the plugin. - -Pro tip: if you faced the following obscure error, or the nextjs `dev` script just instantly terminates the process without any errors, -it most likely means that SWC is not happy with your nextjs version, so try upgrading it to `latest` if possible, -then let us know of your current broken version to try fixing it or documenting its no longer supported. - -```sh -thread '' panicked at 'failed to invoke plugin: failed to invoke plugin on 'Some("/app/node_modules/next/dist/client/router.js")' -``` - - - The SWC plugin is not bundled in the `client-preset` package, so you will need to install it separately: ```sh npm2yarn -npm i -D @graphql-codegen/client-preset-swc-plugin +npm i -D @swc-contrib/plugin-graphql-codegen-client-preset ``` #### General @@ -650,7 +634,7 @@ To use the SWC plugin without Next.js, update your `.swcrc` to add the following // ... experimental: { plugins: [ - ['@graphql-codegen/client-preset-swc-plugin', { artifactDirectory: './src/gql', gqlTagName: 'graphql' }] + ['@swc-contrib/plugin-graphql-codegen-client-preset', { artifactDirectory: './src/gql', gqlTagName: 'graphql' }] ] } } @@ -670,7 +654,7 @@ export default defineConfig({ plugins: [ react({ plugins: [ - ['@graphql-codegen/client-preset-swc-plugin', { artifactDirectory: './src/gql', gqlTagName: 'graphql' }] + ['@swc-contrib/plugin-graphql-codegen-client-preset', { artifactDirectory: './src/gql', gqlTagName: 'graphql' }] ] }) ] @@ -686,7 +670,7 @@ const nextConfig = { // ... experimental: { swcPlugins: [ - ['@graphql-codegen/client-preset-swc-plugin', { artifactDirectory: './src/gql', gqlTagName: 'graphql' }] + ['@swc-contrib/plugin-graphql-codegen-client-preset', { artifactDirectory: './src/gql', gqlTagName: 'graphql' }] ] } }