
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
@victorandree/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.
[!IMPORTANT] 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.
This version is 0.7.0. It's built with
swc_core
16.2.2. To understand if this version is compatible with your project/runtime, check https://plugins.swc.rs/versions/range.@victorandree maintains this fork and releases new versions when I find it useful for myself. I typically bump
swc_core
in Cargo.toml, build the plugin and try it out with a sample Next.js project before releasing. I don't provide any support for other users.
@victorandree/graphql-codegen-client-preset-swc-plugin
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 @victorandree/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: [
['@victorandree/graphql-codegen-client-preset-swc-plugin', { artifactDirectory: './src/gql', gqlTagName: 'graphql' }]
]
})
]
})
const nextConfig = {
// ...
experimental: {
swcPlugins: [
['@victorandree/graphql-codegen-client-preset-swc-plugin', { artifactDirectory: './src/gql', gqlTagName: 'graphql' }]
]
}
}
.swcrc
{
// ...
jsc: {
// ...
experimental: {
plugins: [
['@victorandree/graphql-codegen-client-preset-swc-plugin', { artifactDirectory: './src/gql', gqlTagName: 'graphql' }]
]
}
}
}
To publish a new version ensure you have done the following:
package.json
CHANGELOG.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.
The npm package @victorandree/graphql-codegen-client-preset-swc-plugin receives a total of 2,991 weekly downloads. As such, @victorandree/graphql-codegen-client-preset-swc-plugin popularity was classified as popular.
We found that @victorandree/graphql-codegen-client-preset-swc-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.