Plugins for GraphQL Code Generator, maintained by Lab Digital.
| Package | Version | Description |
|---|---|---|
@labdigital/graphql-codegen-bruno |
Generates a Bruno request (.bru file) for every GraphQL operation in your codebase. |
|
@labdigital/graphql-codegen-k6 |
Generates a typed SDK for your GraphQL operations that you can use in k6 load tests. | |
@labdigital/graphql-codegen-typedefs |
Generates a TypeScript module that exports your GraphQL schema as a typeDefs document. |
- Node.js 22 or newer
graphql^16.0.0 || ^17.0.0@graphql-codegen/cli7.x
All packages are published as ES modules only.
Install the CLI and the plugin you need, then reference the plugin by its
package name in your codegen.ts:
pnpm add -D @graphql-codegen/cli graphql @labdigital/graphql-codegen-typedefsimport type { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
schema: "schema.graphql",
generates: {
"src/generated/typedefs.ts": {
plugins: ["@labdigital/graphql-codegen-typedefs"],
},
},
};
export default config;pnpm graphql-codegen --config codegen.tsSee the README of each package for its configuration options and example output.
This is a pnpm workspace (pnpm 12, see packageManager in
package.json) using Turborepo for builds,
tsdown for bundling, Vitest for
tests and Biome for formatting and linting.
pnpm install # install dependencies
pnpm build # build all packages (packages/*/dist)
pnpm test # run the tests
pnpm check # biome ci + typecheck, as run in CI
pnpm format # apply biome formatting and safe fixesReleases are managed with Changesets.
-
Add a changeset to every pull request that changes a published package:
pnpm changeset
-
When the pull request is merged into
main, the release workflow opens (or updates) a "Release new version" pull request that bumps the versions and updates the changelogs. -
Merging that pull request publishes the new versions to npm (with provenance, via npm trusted publishing).
MIT © Lab Digital