
Product
A New Overview in our Dashboard
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.
@graphql-codegen/client-preset-swc-plugin
Advanced tools
A SWC plugin for https://the-guild.dev/graphql/codegen/plugins/presets/preset-client
@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 @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: [
['@graphql-codegen/client-preset-swc-plugin', { artifactDirectory: './src/gql', gqlTagName: 'graphql' }]
]
})
]
})
const nextConfig = {
// ...
experimental: {
swcPlugins: [
['@graphql-codegen/client-preset-swc-plugin', { artifactDirectory: './src/gql', gqlTagName: 'graphql' }]
]
}
}
.swcrc
{
// ...
jsc: {
// ...
experimental: {
plugins: [
['@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
The npm package @graphql-codegen/client-preset-swc-plugin receives a total of 5,018 weekly downloads. As such, @graphql-codegen/client-preset-swc-plugin popularity was classified as popular.
We found that @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 4 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.
Product
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.