Master GraphQL Federation
& Distributed Schema Management
Production-grade patterns, architectural trade-offs, and deep technical guides for building, scaling, and maintaining federated GraphQL APIs — from subgraph boundaries and entity resolution through contracts, subscriptions, gateway security, and the observability that keeps a distributed graph running.
Engineering-first federation guidance
GraphQL Federation fundamentally transforms how organizations build distributed APIs — replacing monolithic schemas with independently owned subgraphs that compose into a unified supergraph. The architectural decisions made early in a federation project cascade through deployment velocity, runtime performance, and team autonomy for years.
This resource covers the full federation stack across three sections and more than
eighty in-depth guides: Apollo Federation v2+ composition rules,
@key, @external, @requires, and @provides
directive semantics, abstract types and @interfaceObject, schema conflict
resolution, contracts and filtered variants, CI/CD pipeline integration with Apollo Rover,
and resolver performance patterns including DataLoader batching and entity caching.
Whether you are extracting a monolith's GraphQL schema into domain-owned subgraphs, debugging composition failures in your gateway, publishing a filtered public API, running federated subscriptions at scale, or hardening the router that fronts every operation — the guides here provide production-tested patterns with real SDL examples, trade-off tables, and step-by-step debugging workflows.
Real SDL Examples
Every concept backed by annotated GraphQL schema definitions and TypeScript resolver code.
Debugging Workflows
Step-by-step CLI commands and router query plan tracing for common federation failures.
Trade-off Tables
Structured comparisons of latency, consistency, and complexity for every architectural decision.
CI/CD Integration
Apollo Rover pipelines, schema linting, composition validation, and zero-downtime deployment strategies.
Start here
Five areas were added most recently, each with focused walkthroughs underneath them. They are the ones teams reach for once the basic graph is composing.
Contracts & schema variants
Serve a public, a partner and an internal API from one supergraph — filtered at composition time, not guarded at runtime.
Interfaces & unions across subgraphs
Abstract types spanning services, and how @interfaceObject collapses one fetch per implementation into one fetch total.
Error handling & partial responses
Why one team's nullability choice decides how far another team's outage travels, and how to design a graph that degrades.
Subscriptions in federated GraphQL
One stream, one owning subgraph, and enrichment costed per event — plus what breaks the moment you add a replica.
Securing the federated gateway
Persisted-operation safelists, depth and alias limits, rate limiting, and the claims subgraphs are allowed to trust.
Identifying entity ownership
The one federation decision you cannot cheaply revise, and a procedure for making it from meaning rather than from storage.
Explore the Content
Architecture patterns, schema composition, conflict resolution, gateway routing, contracts and variants, and CI/CD integration.
- Defining Subgraph Boundaries
- Cross-Service Type References
- Gateway Routing Strategies
- Resolving Schema Conflicts
- Schema Validation in CI/CD
- Type Ownership & Contracts
- Schema Registry & Managed Federation
- Contracts & Schema Variants
Entity resolvers, @key directives, @external/@requires patterns, custom scalars, shared enums, abstract types, error handling, and performance optimization.
- Implementing Entity Resolvers
- @external & @requires Patterns
- Optimizing Reference Resolvers
- Custom Scalars in Federation
- Cross-Service Authorization
- Managing Shared Enums
- Interfaces & Unions Across Subgraphs
- Error Handling & Partial Responses
Running federation in production: the Apollo Router, distributed tracing, caching, subscriptions, gateway security, schema versioning, and REST-to-subgraph migration.
- Apollo Router Configuration
- Observability & Distributed Tracing
- Caching Strategies
- Migrating & Versioning Schemas
- Subscriptions in Federated GraphQL
- Securing the Federated Gateway