Import Types Preset

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

Version
5.0.0
Weekly downloads
583k
License
MIT
Updated
Nov 11, 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.