Gatsby Plugin Codegen screenshot

Gatsby Plugin Codegen

Author Avatar Theme by Daugsbi
Updated: 9 Jul 2021
18 Stars

Wrapper of apollo:codegen to generate client side types from your queries as well as the gatsby schema & apollo config to provide autocomplete with apollographql.vscode-apollo

Categories

Overview

If you’re working with Gatsby and leveraging GraphQL queries, then gatsby-plugin-codegen is a must-have tool. This powerful plugin streamlines the process of generating TypeScript or Flow type definitions directly from your Gatsby queries, ultimately enhancing the development experience by providing strong type safety. Not only does it simplify the management of types, but it also facilitates a smoother workflow with enhanced autocomplete features in your development environment.

With seamless integration into your Gatsby project, this plugin sets up the necessary configuration with just a simple installation command. Once configured, it generates an Apollo config file and a local schema file, making it easier for developers to interact with their data effectively and efficiently.

Features

  • Type Definitions Generation: Automatically generates TypeScript or Flow definitions from your Gatsby queries for better type safety.
  • Apollo Config File Creation: Creates an Apollo config file that streamlines your GraphQL setup.
  • Local Schema File Export: Exports a file from the Gatsby schema for easier access and management of your GraphQL types.
  • Enhanced Autocomplete in VSCode: Allows for improved autocomplete functionalities in Visual Studio Code through integration with Apollo tooling.
  • Simple Installation: Install with a single command (npm install --save gatsby-plugin-codegen), making it easy to get started.
  • Flexible Configuration: Offers various options for configuring and customizing the output to fit your project’s needs.
  • Documentation Support: Comprehensive documentation is available to guide users through setup and utilization.