gatsby-plugin-schema-snapshot
Create a snapshot of the GraphQL schema.
Saves a minimal schema to file, adds the @dontInfer
directive to all top-level types, and re-creates the schema from the saved type definitions during bootstrap. Use this plugin if you intend to lock-down a project's GraphQL schema.
Options
All configuration options are optional.
{
path: `schema.gql`,
include: {
types: [],
plugins: [],
},
exclude: {
types: [],
plugins: [],
},
withFieldTypes: true,
update: false,
}
Example
module.exports = {
plugins: [
{
resolve: `gatsby-plugin-schema-snapshot`,
options: {
path: `schema.gql`,
exclude: {
plugins: [`gatsby-source-npm-package-search`],
},
update: process.env.GATSBY_UPDATE_SCHEMA_SNAPSHOT,
},
},
],
}