description GraphQL Federation (Apollo Federation) Overview
An advanced pattern for building large, distributed APIs where multiple independent services (subgraphs) can expose their data through a single, unified GraphQL endpoint. It solves the 'API gateway' problem by allowing services to evolve independently while maintaining a consistent client view. While powerful for decoupling, setting up the gateway and ensuring schema compatibility across all services is a major undertaking.
help GraphQL Federation (Apollo Federation) FAQ
What is Apollo Federation used for?
Apollo Federation is an architecture for building a single, unified GraphQL API from multiple independent backend services, known as subgraphs. It allows engineering teams to scale their APIs by breaking a monolithic graph into smaller, maintainable pieces.
What is the difference between a supergraph and a subgraph in Apollo?
In Apollo Federation, a subgraph is an individual GraphQL API maintained by a specific team, whereas the supergraph is the single, unified API gateway. A routing server, like the Apollo Router, queries the subgraphs to compose the supergraph.
Do I need a specific GraphQL server to use Federation?
Yes, to implement Apollo Federation, your backend services must run GraphQL servers that support the federation specification. The Apollo Server library is the most common choice, though other servers like Mercurius also support it.
How does Federation resolve data across different subgraphs?
It uses special directives, like the `@requires` and `@provides` directives, to define how entities are shared and resolved across subgraphs. This allows one service to retrieve data from another seamlessly without duplicating database schemas.
explore Explore More
Similar to GraphQL Federation (Apollo Federation)
compare_arrows Compare: Amazon Bedrock API See all arrow_forwardReviews & Comments
Write a Review
Be the first to review
Share your thoughts with the community and help others make better decisions.