Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jfrolich/gatsby-plugin-extract-schema

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jfrolich/gatsby-plugin-extract-schema

Extract Gatsby's generated graphql schema to a JSON file

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

gatsby-plugin-extract-schema

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

You can use this file to check your queries against your schema, by using eslint-plugin-graphql.

Install

Extract schema: npm install --save gatsby-plugin-extract-schema

Use extracted schema: npm install --save-dev eslint babel-eslint eslint-plugin-graphql

How to use

Edit gatsby-config.js

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

or

{
  resolve: "gatsby-plugin-extract-schema",
    options: {
      dest: `${__dirname}/path/to/schema.json`,
    },
  },
}

Check queries against schema

Add .eslintrc.js to the project root

const path = require("path");
module.exports = {
  parser: "babel-eslint",
  rules: {
    "graphql/template-strings": [
      "error",
      {
        env: "relay",
        schemaJsonFilepath: path.resolve(__dirname, "./schema.json"),
        tagName: "graphql"
      }
    ]
  },
  plugins: ["graphql"]
};

Big thanks to Kurtis Kemple for all his help!

Keywords

FAQs

Package last updated on 08 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc