1.1.1 ā€¢ Published 4 years ago

gridsome-plugin-extract-schema v1.1.1

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

gridsome-plugin-extract-schema

A Gridsome plugin that extracts your graphql schema to a .json file.

Why do I need this?

Modern IDE's (VSCode, IntelliJ, etc) can autocomplete and verify your graphql queries if they're setup properly: https://graphql-config.com/introduction

Demo

Install

npm install --save gridsome-plugin-extract-schema

How to use

Edit your gridsome.config.js

module.exports = {
  plugins: ["gridsome-plugin-extract-schema"]
};

or

{
  use: "gridsome-plugin-extract-schema",
  options: {
    dest: `${__dirname}/src/.temp/schema.json` // Default
  }
}

Create a .graphqlconfig file in your project root

{
  "schemaPath": "src/.temp/schema.json",
  "extensions": {
    "endpoints": {
      "dev": {
        "url": "http://localhost:8080/___graphql"
      }
    }
  }
}

šŸ’„ Boom, now your IDE should be able to autocomplete and validate your QraphQL queries.

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago