@@ -617,26 +617,10 @@ module.exports = {
617617
618618### SWC Plugin
619619
620- <Callout type = " warning" >
621- As of 2023/03/11, SWC's custom plugins is still an experimental feature, that means unexpected breaking changes that
622- makes specific nextjs versions or our plugin incompatible are possible, so please file an issue
623- [ here] ( https://github.com/dotansimha/graphql-code-generator/issues/new?assignees=&labels=&template=bug_report.yml&title=@graphql-codegen/client-preset-swc-plugin%20... )
624- if you faced any unexpected behavior/errors while using the plugin.
625-
626- Pro tip: if you faced the following obscure error, or the nextjs ` dev ` script just instantly terminates the process without any errors,
627- it most likely means that SWC is not happy with your nextjs version, so try upgrading it to ` latest ` if possible,
628- then let us know of your current broken version to try fixing it or documenting its no longer supported.
629-
630- ``` sh
631- thread ' <unnamed>' panicked at ' failed to invoke plugin: failed to invoke plugin on ' Some(" /app/node_modules/next/dist/client/router.js" )'
632- ```
633-
634- </Callout>
635-
636620The SWC plugin is not bundled in the ` client-preset ` package, so you will need to install it separately:
637621
638622``` sh npm2yarn
639- npm i -D @graphql-codegen/ client-preset-swc-plugin
623+ npm i -D @swc-contrib/plugin- graphql-codegen- client-preset
640624```
641625
642626#### General
@@ -650,7 +634,7 @@ To use the SWC plugin without Next.js, update your `.swcrc` to add the following
650634 // ...
651635 experimental: {
652636 plugins: [
653- [' @graphql-codegen/ client-preset-swc-plugin ' , { artifactDirectory: ' ./src/gql' , gqlTagName: ' graphql' }]
637+ [' @swc-contrib/plugin- graphql-codegen- client-preset' , { artifactDirectory: ' ./src/gql' , gqlTagName: ' graphql' }]
654638 ]
655639 }
656640 }
@@ -670,7 +654,7 @@ export default defineConfig({
670654 plugins: [
671655 react ({
672656 plugins: [
673- [' @graphql-codegen/ client-preset-swc-plugin ' , { artifactDirectory: ' ./src/gql' , gqlTagName: ' graphql' }]
657+ [' @swc-contrib/plugin- graphql-codegen- client-preset' , { artifactDirectory: ' ./src/gql' , gqlTagName: ' graphql' }]
674658 ]
675659 })
676660 ]
@@ -686,7 +670,7 @@ const nextConfig = {
686670 // ...
687671 experimental: {
688672 swcPlugins: [
689- [' @graphql-codegen/ client-preset-swc-plugin ' , { artifactDirectory: ' ./src/gql' , gqlTagName: ' graphql' }]
673+ [' @swc-contrib/plugin- graphql-codegen- client-preset' , { artifactDirectory: ' ./src/gql' , gqlTagName: ' graphql' }]
690674 ]
691675 }
692676}
0 commit comments