This chapter follows Evolving a GraphQL schema.
A single repository may publish multiple GraphQL endpoints or variants of one supergraph. Governance connects schema changes to owners, consumers, and compliance requirements.
Multiple audiences
| Audience | Typical constraints |
|---|---|
| Public | Strict backward compatibility, rate limits, minimal introspection |
| Partner | Contractual SLAs, allowlisted operations, separate auth |
| Internal | Richer schema, faster iteration, may share federation with public subset |
Contracts (GraphOS contracts, Hive, Cosmo variants) filter which types and fields appear per audience from one composed supergraph or subgraph set.
Schema registries and environments
A schema registry stores subgraph SDL, composition results, and changelog history:
- Apollo GraphOS — schema checks, launches, field metrics
- GraphQL Hive — open-core registry, usage reporting, CDN
- WunderGraph Cosmo — federation composition and routing
Promote schemas dev → staging → prod with the same CI gates. Drift between environments causes “works on staging” incidents when composition differs.
CI checks against real operations
Pull requests should run:
- Schema diff against the target environment
- Breaking change detection on registered operations (client repos, mobile bundles, partner documents)
- Lint rules (naming, mutation payloads, max nesting) via graphql-eslint or custom rules
- Ownership — CODEOWNERS on
schema.gqlor generated SDL paths
Failing a check blocks merge until consumers update or the change is reclassified as safe.
Ownership and documentation
Assign domain teams to types (@tag(name: "checkout") in federation, or internal docs). Descriptions in SDL are the first line of API documentation—keep them accurate when deprecating.
Run weekly reports of orphaned types (no client usage) to prune schema debt.
Versioning strategies
GraphQL spec discourages /v1 URLs, but organizations still choose policy:
| Strategy | Idea | Example pattern |
|---|---|---|
| Continuous evolution | One graph, deprecations only | GitHub public API |
| Dated versions | Quarterly snapshots with migration guides | Shopify Admin API dated releases |
| Calendar breaking windows | Announce removals months ahead | GitHub breaking-change blog |
Pick one strategy per audience. Mixing undocumented continuous change with partner contracts without registry checks creates support churn.
Check your understanding
Question 1 of 5
0 of 5 checked