Skip to content
Snippets Groups Projects
user avatar
3712d7d4
History

gatsby-plugin-typegen

Watch changes, Automatically generates TypeScript definitions.

  • Schema extraction
  • Generates code using graphql-codegen
  • Options to customize inputs/outputs (More plugins, Schema-JSON/SDL output option, Type definitions, etc)
  • Auto-fixing codes using <StaticQuery> and useStaticQuery() with generated type parameters.

Requirements

  • Node v10.0.0 +
  • GatsbyJS v2 +

Install

yarn add gatsby-plugin-typegen

# or
# npm install --save gatsby-plugin-typegen

How to use

// In your gatsby-config.js
plugins: [`gatsby-plugin-typegen`]

Available options

TODO

Acknowledgements