Registry / devops / graphql-codegen-add

graphql-codegen-add

JSON →
library0.18.2jsnpmunverified

A plugin for GraphQL Code Generator that adds custom content to generated output files. It is part of the GraphQL Code Generator ecosystem (v0.18.x, now legacy; replaced by v2+ with `@graphql-codegen/add`). This plugin appends or prepends arbitrary code snippets to generated files, useful for adding imports, utilities, or type extensions. It is often used in conjunction with other plugins to enhance generated TypeScript typings for client and server sides. The package is in maintenance mode; users should migrate to the v2 package (`@graphql-codegen/add`).

npm install graphql-codegen-add
INSTALL
IMPORT
SIG · GRAPHQL-CODEGEN-AD
G
graphql-codegen-add
devopsjavascriptv0.18.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (plugin)
import AddPlugin from 'graphql-codegen-add';
The plugin is used via graphql-codegen.yml configuration, not directly imported in application code.

Example graphql-codegen.yml configuration showing how to use the add plugin to prepend a comment to generated TypeScript typings.

// Configure in graphql-codegen.yml overwrite: true schema: "http://localhost:4000/graphql" documents: "src/**/*.graphql" generates: src/generated/graphql.ts: plugins: - typescript - typescript-operations - graphql-codegen-add: content: "// THIS IS A GENERATED FILE - DO NOT EDIT" config: maybeValue: T | undefined
Debug
Known issues
deprecatedPackage 'graphql-codegen-add' is deprecated. Use '@graphql-codegen/add' instead.
fix
Replace in package.json: 'graphql-codegen-add' with '@graphql-codegen/add' and update imports/config accordingly.
affects: >=0.1.0
gotchaThe 'content' option must be passed as a string, not an array or object.
fix
Ensure content is a string in graphql-codegen.yml.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'graphql-codegen-add'
Package not installed or misspelled name.
fix
Run: npm install graphql-codegen-add
Plugin graphql-codegen-add not found
GraphQL Code Generator version mismatch; plugin is for older version.
fix
Ensure you are using graphql-codegen v0.18.x, or migrate to @graphql-codegen/add for v2+.
Upgrade
Version history
0.18.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
9
Resources
graphql-codegen-add — npm install graphql-codegen-add · libregistry