GraphQL Federation allows you to build a single, unified data graph by combining multiple backend services (subgraphs). The gateway intelligently plans and executes queries across these services. This guide covers the core directives and concepts that make it work.
We'll use a simple e-commerce example with three subgraphs:
- Users Service: Manages user data (
id,name). - Products Service: Manages product data (
upc,price,name). - Reviews Service: Manages reviews, which are linked to users and products.