Why do we need federation?
As established in the introduction, GraphQL Federation is an incredibly powerful tool for building scalable and flexible GraphQL APIs. It allows you to break down a monolithic GraphQL schema into smaller, more manageable services called microservices. Each microservice represents a specific domain or functionality within your application.
The possibilities for federated microservices are endless, but nevertheless, here are a few:
- Your backend can integrate with external GraphQL services, even if you don’t have access to the source code
- Your schema is really big and you want to break it into smaller, more manageable schemas
- You are using multiple REST and GraphQL services but want to provide a unified GraphQL server experience
By including one schema within another, we can leverage the benefits of modular design and code reuse. It allows us to create smaller, more focused schemas that can be combined to form a larger and more...