Add
Adds custom text to your output file. You can use this plugin to add custom code, imports, comments and more to your output file.
- Package
- @graphql-codegen/add
- Version
- 7.1.0
- Weekly downloads
- 7.3M
- License
- MIT
- Updated
- Jul 6, 2026
Installation
npm i -D @graphql-codegen/add
yarn add -D @graphql-codegen/add
pnpm add -D @graphql-codegen/add
bun add -D @graphql-codegen/add
Config API Reference
placement
type: string
Allow you to choose where to add the content. Default value: “prepend”
content
type: object
The actual content you wish to add, either a string or array of strings. You can also specify a path to a local file and the content if it will be loaded by codegen.
add plugin adds custom text to your output file.
You can use this plugin to add custom code, imports, comments and more to your output file.