What is schema composition and conflict detection in Apollo Federation?
Answer
Schema composition in Apollo Federation is the process by which the Apollo Router (or Apollo Studio) merges all subgraph schemas into a single unified supergraph SDL. Composition applies semantic rules to detect conflicts and validate that the merged schema is coherent. Composition errors include: two subgraphs defining the same type with incompatible fields, an @key referencing fields that do not exist, or type extensions for non-existent base types. Composition succeeds only when all rules pass. The schema registry in Apollo Studio stores each subgraph's schema versioned by deployment. The rover subgraph check CLI command runs composition and breaking change detection against all registered client operations in CI, failing the pipeline if the proposed change would break any active client. This creates a safe, automated governance layer that prevents incompatible subgraph deployments from reaching production.
Previous
How do you scale GraphQL subscriptions using Redis pub/sub?
Next
What is a schema registry and GraphQL governance at scale?
More GraphQL Questions
View all →- Advanced What is Apollo Federation and how do subgraphs, gateways, and directives like @key and @extends work?
- Advanced What is incremental delivery in GraphQL with @defer and @stream?
- Advanced How do you implement query cost analysis and rate limiting in a production GraphQL API?
- Advanced What is schema evolution and deprecation strategy in GraphQL?
- Advanced What is the Relay specification for GraphQL — Node interface, Connection/Edge pagination?