From b0bc75712a1c2143a6e8ecf1a7a92f4082e8910f Mon Sep 17 00:00:00 2001 From: Yi-Jyun Pan Date: Sat, 13 Sep 2025 00:45:25 +0800 Subject: [PATCH] feat: set up plugin-graphql-codegen-client-preset --- next.config.ts | 3 +++ package.json | 1 + pnpm-lock.yaml | 9 +++++++++ 3 files changed, 13 insertions(+) diff --git a/next.config.ts b/next.config.ts index 019ae2b..27d6d11 100644 --- a/next.config.ts +++ b/next.config.ts @@ -5,6 +5,9 @@ const nextConfig: NextConfig = { reactStrictMode: true, experimental: { reactCompiler: true, + swcPlugins: [ + ["@swc-contrib/plugin-graphql-codegen-client-preset", { artifactDirectory: "./gql", gqlTagName: "graphql" }], + ], }, }; diff --git a/package.json b/package.json index 4f03e6c..1aa8b7c 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "@radix-ui/react-separator": "^1.1.7", "@radix-ui/react-slot": "^1.2.3", "@radix-ui/react-tooltip": "^1.2.8", + "@swc-contrib/plugin-graphql-codegen-client-preset": "^0.6.0", "@tanstack/react-table": "^8.21.3", "babel-plugin-react-compiler": "19.1.0-rc.3", "class-variance-authority": "^0.7.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 024f81a..daa25b5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -50,6 +50,9 @@ importers: '@radix-ui/react-tooltip': specifier: ^1.2.8 version: 1.2.8(@types/react-dom@19.1.9(@types/react@19.1.12))(@types/react@19.1.12)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + '@swc-contrib/plugin-graphql-codegen-client-preset': + specifier: ^0.6.0 + version: 0.6.0 '@tanstack/react-table': specifier: ^8.21.3 version: 8.21.3(react-dom@19.1.1(react@19.1.1))(react@19.1.1) @@ -1547,6 +1550,10 @@ packages: '@standard-schema/utils@0.3.0': resolution: {integrity: sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==} + '@swc-contrib/plugin-graphql-codegen-client-preset@0.6.0': + resolution: {integrity: sha512-E3PUJ6HV708XOmfsCF11xAY15hNQyFqwWS5s0Z4sKb4nWbGs8OoXl0prCSLrilUXFhcyFLdk4PEhsPO6n7rQfA==} + engines: {node: '>=16'} + '@swc/helpers@0.5.15': resolution: {integrity: sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==} @@ -5571,6 +5578,8 @@ snapshots: '@standard-schema/utils@0.3.0': {} + '@swc-contrib/plugin-graphql-codegen-client-preset@0.6.0': {} + '@swc/helpers@0.5.15': dependencies: tslib: 2.8.1