Skip to main content

All Presets

GraphQL Code Generator also support presets - which is a way to manipulate and affect the execution of plugins.

Presets are CLI extensions, that allow manipulation of a generates section of codegen, based on custom logic.

You can use and writes presets to tell codegen which output files to creates, and what each one should include.

Available Presets#

NamePurposePackage Name & Docs
near-operation-fileGenerates operation code near the source file@graphql-codegen/near-operation-file-preset
import-types-Allow you to separate base types declarations and the operations that uses it@graphql-codegen/import-types-preset
graphql-modulesGenerates types and resolvers signature for GraphQL-Modules@graphql-codegen/graphql-modules-preset