
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
@benjibenji/graphql-codegen-client-preset-swc-plugin
Advanced tools
A SWC plugin for https://the-guild.dev/graphql/codegen/plugins/presets/preset-client. Forked to work with new Next.js versions and client components.
This is an unsupported fork to make the plugin work with new versions of Next.js and "use client" directives. Use at your own peril.
@benjibenji/graphql-codegen-client-preset-swc-plugin[!NOTE] Updated to use SWC core 0.90.* to support Next.js 14.2.0
When using the @graphql-codegen/client-preset on large scale projects might want to enable code splitting or tree shaking on the client-preset generated files. This is because instead of using the map which contains all GraphQL operations in the project, we can use the specific generated document types.
This plugin works for SWC only.
yarn add -D @benjibenji/graphql-codegen-client-preset-swc-plugin
You will need to provide the artifactDirectory path that should be the same as the one configured in your codegen.ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react({
plugins: [
['@benjibenji/graphql-codegen-client-preset-swc-plugin', { artifactDirectory: './src/gql', gqlTagName: 'graphql' }]
]
})
]
})
const nextConfig = {
// ...
experimental: {
swcPlugins: [
['@benjibenji/graphql-codegen-client-preset-swc-plugin', { artifactDirectory: './src/gql', gqlTagName: 'graphql' }]
]
}
}
.swcrc{
// ...
jsc: {
// ...
experimental: {
plugins: [
['@benjibenji/graphql-codegen-client-preset-swc-plugin', { artifactDirectory: './src/gql', gqlTagName: 'graphql' }]
]
}
}
}
To publish a new version ensure you have done the following:
package.jsonCHANGELOG.md with the new version and changesRust plugin workflowFAQs
A SWC plugin for https://the-guild.dev/graphql/codegen/plugins/presets/preset-client. Forked to work with new Next.js versions and client components.
We found that @benjibenji/graphql-codegen-client-preset-swc-plugin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.