Schema Snapshot Restore: Does it Re‑install Resolvers?
0 reputation · 11 Apr 2024, 21:04 UTC
Goal
After a plugin that adds custom types via createSchemaCustomization is removed, a developer wishes to roll back the GraphQL schema to its prior state using Gatsby’s schema‑snapshot feature.
Uncertainty
The Gatsby documentation states that a snapshot captures the schema after all plugins run, but it does not specify whether a restore also re‑installs the associated resolvers or only the type definitions. Additionally, the ordering of createSchemaCustomization callbacks is not explicitly guaranteed, potentially leaving stale or duplicated resolver definitions after a rollback.
Specific Questions
- When a snapshot is restored, are the original resolver functions for custom types re‑registered, or are only the type definitions restored?
- Does the restore process clean up resolver definitions that were added by a plugin that has since been removed?
- Is the order of
createSchemaCustomizationcallbacks deterministic across all plugin types, and how does this affect rollback consistency?