vite-plugin-graphql-codegen weekly downloads statistics
By danielwaltz · npm · Vite plugins
Zero-config vite plugin that uses the vite file watcher to run graphql codegen programmatically without needing to start a separate watcher
vite-plugin-graphql-codegen has 31,418 recorded weekly downloads on npm, a decrease of 45.0% over the past 30 days, ranking #676 of 2,322 tracked listings.
About vite-plugin-graphql-codegen
Vite Plugin GraphQL Codegen 
Zero-config vite plugin that uses the vite file watcher to run graphql codegen programmatically without needing to start a separate watcher.
Setup GraphQL Codegen
Installation instructions found here. Optional if already set up in project.
Install Plugin
# ✨ Auto-detect
npx nypm install -D vite-plugin-graphql-codegen
# vp
vp install -D vite-plugin-graphql-codegen
# npm
npm install -D vite-plugin-graphql-codegen
# yarn
yarn add -D vite-plugin-graphql-codegen
# pnpm
pnpm install -D vite-plugin-graphql-codegen
# bun
bun add -D vite-plugin-graphql-codegen
# deno
deno install -D vite-plugin-graphql-codegen
Initialize Plugin
// vite.config.ts
import { defineConfig } from "vite";
import codegen from "vite-plugin-graphql-codegen";
export default defineConfig({
plugins: [codegen()],
});
Options
Providing options is not required as sensible defaults are in place, but there may be times where it's helpful to disable codegen under certain circumstances, like when running builds in CI.
codegen({
/**
* Run codegen on server start.
*
* @default true
*/
runOnStart: boolean,
/**
* Run codegen on build. Will prevent build if codegen fails.
*
* @default true
*/
runOnBuild: boolean,
/**
* Enable codegen integration with vite file watcher.
*
* @default true
*/
enableWatcher: boolean,
/**
* Automatically add schemas and documents referenced in the codegen config
* to the file watcher.
*
* @default true
*/
watchCodegenConfigFiles: boolean,
/**
* Throw an error if codegen fails on server start.
*
* @default false
*/
throwOnStart: boolean,
/**
* Throw an error if codegen fails on build.
*
* @default true
*/
throwOnBuild: boolean,
/**
* Run codegen when a document matches.
*
* @default true
*/
matchOnDocuments: boolean,
/**
* Run codegen when a schema matches.
*
* @default false
*/
matchOnSchemas: boolean,
/**
* Manually define the codegen config.
*/
config: CodegenConfig,
/**
* Override parts of the codegen config just for this plugin.
*/
configOverride: Partial<CodegenConfig>,
/**
* Override parts of the codegen config just for this plugin on server start.
*/
configOverrideOnStart: Partial<CodegenConfig>,
/**
* Override parts of the codegen config just for this plugin on build.
*/
configOverrideOnBuild: Partial<CodegenConfig>,
/**
* Override parts of the codegen config just for this plugin in the watcher.
*/
configOverrideWatcher: Partial<CodegenConfig>,
/**
* Override the codegen config file path.
*/
configFilePathOverride: string,
/**
* Skip codegen for a given cycle when true.
*
* The callback receives the current trigger and the changed file path
* for watcher-driven runs.
*/
skip:
boolean |
((context: { trigger: "start" | "build" | "watch"; filePath?: string }) =>
boolean | Promise<boolean>),
/**
* Log various steps to aid in tracking down bugs.
*
* @default false
*/
debug: boolean,
});
Description from the npm listing.
- graphql
- codegen
- graphql-codegen
- graphql-code-generator
- vite
- vite-plugin
- vite-plugin-graphql-codegen
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (122)Similar npm Vite plugins plugins
All 20 vite-plugin-graphql-codegen alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/vite-plugin-graphql-codegen. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.