Import Types Preset

This preset generates a file per each operation file, and allow to import types from another file.

Version
4.0.1
Weekly downloads
432k
License
MIT
Updated
Apr 19, 2026

Installation

          npm i -D @graphql-codegen/import-types-preset
        

Config API Reference

typesPath

type: string

Required, should point to the base schema types file. The key of the output is used a the base path for this file.

importTypesNamespace

type: string

Optional, override the name of the import namespace used to import from the baseTypesPath file. Default value: “Types”

This preset generates a file per each operation file, and allow to import types from another file.