GraphQL Federation Vocabulary
5 exercises — master federation vocabulary: subgraphs and supergraphs, Apollo Federation, the @key directive, entity extension across subgraphs, schema stitching vs federation, and query plan representations.
0 / 5 completed
GraphQL Federation vocabulary quick reference
- Subgraph — a team-owned GraphQL service with a partial schema
- Supergraph — the composed, unified GraphQL schema merging all subgraphs
- Federation gateway / router — routes and composes queries across subgraphs
- @key directive — declares an entity's primary key; enables cross-subgraph entity resolution
- Entity extension — a subgraph adding fields to an entity defined in another subgraph
- Representation — minimal object ({__typename, @key fields}) sent to an extending subgraph
- Schema stitching — older, manual approach vs Federation's declarative, spec-driven approach
1 / 5
What is GraphQL Federation, and what problem does it solve compared to a single monolithic GraphQL schema?
Federation solves the "who owns the schema?" problem at organisational scale.
The monolithic GraphQL schema problem:
• A single GraphQL service starts simple but grows with every new team and feature
• All teams submit schema changes to one repository — merge conflicts, slow reviews, deployment coupling
• One team's schema breaking change can block all other teams' deployments
Federation architecture:
• Each team deploys their subgraph independently
• Schema changes are reviewed and approved per-team
• The gateway composes everything — clients see one unified API
• One subgraph going down doesn't necessarily take down the entire API
Real-world adoption:
Apollo Federation (spec + router) is the dominant implementation, used by Netflix, Expedia, Wayfair, and others with 50+ teams sharing a GraphQL API.
Key vocabulary:
• Subgraph — a team-owned GraphQL service with a partial schema and its own data sources
• Supergraph — the complete, composed GraphQL schema created by merging all subgraphs
• Federation gateway / router — the entry point that routes and composes queries across subgraphs
• Schema composition — the process of merging subgraph schemas into the supergraph
The monolithic GraphQL schema problem:
• A single GraphQL service starts simple but grows with every new team and feature
• All teams submit schema changes to one repository — merge conflicts, slow reviews, deployment coupling
• One team's schema breaking change can block all other teams' deployments
Federation architecture:
Client ↓ [Federation Gateway / Router] ← Composes subgraphs into the supergraph ↓ ↓ ↓ [Users Subgraph] [Orders Subgraph] [Products Subgraph] (Auth team) (Checkout team) (Catalogue team)Key benefits:
• Each team deploys their subgraph independently
• Schema changes are reviewed and approved per-team
• The gateway composes everything — clients see one unified API
• One subgraph going down doesn't necessarily take down the entire API
Real-world adoption:
Apollo Federation (spec + router) is the dominant implementation, used by Netflix, Expedia, Wayfair, and others with 50+ teams sharing a GraphQL API.
Key vocabulary:
• Subgraph — a team-owned GraphQL service with a partial schema and its own data sources
• Supergraph — the complete, composed GraphQL schema created by merging all subgraphs
• Federation gateway / router — the entry point that routes and composes queries across subgraphs
• Schema composition — the process of merging subgraph schemas into the supergraph