What is schema stitching versus Apollo Federation in GraphQL?
Answer
Schema stitching (from graphql-tools) is an older approach that merges multiple GraphQL schemas into one by combining their types and resolvers at the gateway level. It requires the gateway to know about all sub-schemas and manually define how they connect. Apollo Federation is a newer, more scalable approach where each service owns its own subgraph schema and can extend types owned by other services using @key and @extends directives. The gateway automatically composes the unified supergraph. Federation gives teams true independence — services can be deployed separately, and the gateway generates the query plan automatically. Federation is now the industry standard for microservices-based GraphQL.
Previous
What is the difference between union types and interface types in GraphQL?
Next
How do GraphQL subscriptions work over WebSocket?
More GraphQL Questions
View all →- Intermediate What is the N+1 problem in GraphQL and how does DataLoader solve it?
- Intermediate What are persisted queries in GraphQL?
- Intermediate What is the difference between schema-first and code-first GraphQL approaches?
- Intermediate What are the pagination strategies in GraphQL?
- Intermediate How is authentication handled in GraphQL?