GraphQL Federation
ELI5 — The Vibe Check
GraphQL Federation lets multiple teams own different parts of the same GraphQL API. The Users team manages the User type, the Orders team manages the Order type, and a gateway stitches them into one unified schema. Each team deploys independently. It's like different departments sharing one reception desk.
Real Talk
GraphQL Federation (Apollo Federation) is an architecture for composing multiple GraphQL services into a single, unified graph. Each subgraph owns specific types and fields, and a gateway/router combines them into a supergraph. Services can extend types owned by other services, enabling distributed development while presenting a single API to clients.
Show Me The Code
// Users subgraph
type User @key(fields: "id") {
id: ID!
name: String!
}
// Orders subgraph - extends User
extend type User @key(fields: "id") {
id: ID! @external
orders: [Order!]!
}
When You'll Hear This
"Federation lets each team own their piece of the graph and deploy independently." / "The gateway composes 5 subgraphs into one unified GraphQL API."
Related Terms
API Gateway
An API Gateway is the front door for all your APIs.
GraphQL
GraphQL is like ordering food where YOU specify exactly what you want on your plate.
Microservice
Microservices is an architecture where instead of one big app, you have many tiny apps that each do one thing.
Schema
A database schema is the blueprint of your database — which tables exist, what columns they have, what types they are, and how they relate to each other.