NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #3975 most downloaded on npm
Last release today
25 Sep 2026
Ships unpredictably
gaps range from 8 days to 6 months
Some releases are documented
notes for 31 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
5076 releases · first in 2019
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.
Nothing published for this version
Nothing published for this version
DocumentTransform is a functionality that allows you to modify documents before they are processed by plugins. You can use functions passed to the doc
#8723
a3309e63e
Thanks @kazekyo! - Introduce a new feature called DocumentTransform.
DocumentTransform is a functionality that allows you to modify documents before they are
processed by plugins. You can use functions passed to the documentTransforms option to make
changes to GraphQL documents.
To use this feature, you can write documentTransforms as follows:
import type { CodegenConfig } from '@graphql-codegen/cli'
const config: CodegenConfig = {
schema: 'https://localhost:4000/graphql',
documents: ['src/**/*.tsx'],
generates: {
'./src/gql/': {
preset: 'client',
documentTransforms: [
{
transform: ({ documents }) => {
// Make some changes to the documents
return documents
}
}
]
}
}
}
export default config
For instance, to remove a @localOnlyDirective directive from documents, you can write the
following code:
import type { CodegenConfig } from '@graphql-codegen/cli'
import { visit } from 'graphql'
const config: CodegenConfig = {
schema: 'https://localhost:4000/graphql',
documents: ['src/**/*.tsx'],
generates: {
'./src/gql/': {
preset: 'client',
documentTransforms: [
{
transform: ({ documents }) => {
return documents.map(documentFile => {
documentFile.document = visit(documentFile.document, {
Directive: {
leave(node) {
if (node.name.value === 'localOnlyDirective') return null
}
}
})
return documentFile
})
}
}
]
}
}
}
export default config
DocumentTransform can also be specified by file name. You can create a custom file for a specific
transformation and pass it to documentTransforms.
Let's create the document transform as a file:
module.exports = {
transform: ({ documents }) => {
// Make some changes to the documents
return documents
}
}
Then, you can specify the file name as follows:
import type { CodegenConfig } from '@graphql-codegen/cli'
const config: CodegenConfig = {
schema: 'https://localhost:4000/graphql',
documents: ['src/**/*.tsx'],
generates: {
'./src/gql/': {
preset: 'client',
documentTransforms: ['./my-document-transform.js']
}
}
}
export default config
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →