Creates a snapshot of the Gatsby GraphQL schema by saving minimal type definitions to a file and re-creating the schema from the snapshot during bootstrap. It adds the @dontInfer directive to all top-level types, effectively locking down the schema for production stability. Version 4.16.0 requires Gatsby v5.0.0-next as a peer dependency. This plugin is part of the Gatsby monorepo and is updated alongside Gatsby releases. It is intended for projects that want to prevent schema changes from being introduced unexpectedly, offering control via include/exclude lists and an optional update flag. The plugin is stable but rarely updated independently.
npm install gatsby-plugin-schema-snapshotNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures the plugin in gatsby-config.js to lock the GraphQL schema, excluding types from a specific source plugin, and enabling updates via an environment variable.
Upgrade Gatsby to v5.0.0-next or later, or use an older version of the plugin.
Set 'update: true' or use an environment variable to regenerate the snapshot when needed.
Ensure excluded types are not required for the project's queries. Use 'include' to force inclusion of necessary types.
Consider alternative schema locking strategies or contribute to the plugin.
Use 'module.exports' and CommonJS require syntax in gatsby-config.js.
Run: npm install gatsby-plugin-schema-snapshot
Use the correct format: { resolve: 'gatsby-plugin-schema-snapshot', options: { ... } }Upgrade Gatsby to v5.0.0-next or later.
First generate the snapshot by running with update=true: GATSBY_UPDATE_SCHEMA_SNAPSHOT=true gatsby develop