Different subgraphs can even use completely different libraries, which is helpful if your various backend services use different languages. Note that not all listed libraries support all parts of the subgraph specification.įeel free to use whichever server library best suits your organization.Any of the other server libraries listed in Subgraph-compatible server libraries.Apollo Server supports a variety of popular Node.js middleware, and it works seamlessly with TypeScript.Apollo Server with This is Apollo's open-source Node.js GraphQL server library, which you can configure to act as a subgraph.To act as a subgraph, a GraphQL server library needs to support the Apollo Federation subgraph specification. Therefore, it uses a GraphQL server library to handle queries forwarded along by your graph router. Implementing subgraphsĮach subgraph is itself a GraphQL API. If you get started with one of these libraries and later decide to switch to the other, you can do so without making any changes to the rest of your supergraph. Apollo Server with This is Apollo's open-source Node.js GraphQL server library, which you can configure to act as a supergraph gateway.All it needs is a configuration file for any behavior you want to customize. Because the Apollo Router is a precompiled binary, you don't need to write any boilerplate code around it to deploy it to your backend.This is a high-performance binary written in Rust that adds minimal latency to request processing, even with extremely high traffic. ![]() This series demonstrates creating a supergraph from scratch, along with converting an existing monolithic GraphQL server into a supergraph.Īpollo provides two libraries that can act as your graph router:.If you're already using GraphQL, learn how to implement a supergraph by completing the Voyage tutorial series.Familiarizing yourself with fundamental GraphQL concepts is an important prerequisite to getting the most out of your supergraph.If you're new to GraphQL, we recommend starting your supergraph journey with the Lift-off tutorial series.And more importantly, we provide tutorials to help you! Tutorials Apollo provides libraries and tools for setting up each part. To implement a supergraph, you set up its individual parts: the graph router and your subgraphs. Many benefits of a supergraph are those provided by the GraphQL language and the Apollo Federation architecture.Ī supergraph enables the use of powerful tooling for schema management, metrics aggregation, and change validation. These improvements enable developers to ship products and features more quickly, with greater confidence in their reliability and performance. The following video provides a helpful visualization of how the Apollo Federation architecture works:Īdopting a supergraph significantly improves the developer experience for every team (both internal and external) that interacts with your organization's data. The diagram at the top of this page shows a basic supergraph with two subgraphs and two corresponding data sources. Your subgraphs use these to populate data for incoming queries.Backing data sources (databases, REST APIs, etc.).Usually, each of your existing backend services acts as a different subgraph.Each subgraph is itself a GraphQL API that's responsible for populating a subset of your supergraph's available data.It's also responsible for combining multiple subgraph responses into a single response for the client. As its name suggests, the graph router "routes" each incoming query to the appropriate combination of subgraphs (see the next item).The graph router serves as the client-accessible entry point to your supergraph. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |