GraphQL Summit is back for three days of insights, hands-on learning, and fun to celebrate the GraphQL community. Join us in San Diego Oct 3-5.
Docs
Try Apollo Studio

The Apollo Supergraph Platform

Bring your supergraph from prototype to production


Apollo is a platform for building, managing, and scaling a supergraph: a unified network of your data, services, and capabilities composed into a single, all-purpose API. With just one query to your supergraph, an application client can fetch data from any combination of sources:

Your supergraph
Graph
router
Users
subgraph
Products
subgraph
Users
DB
Products
DB
Client

Clients query your supergraph with a powerful language called GraphQL, which enables them to retrieve exactly the data they need with no overfetching. The architecture of your supergraph is not exposed, and clients query it from a single endpoint.

The supergraph is not a replacement for your existing infrastructure! Instead, it's a methodology for interconnecting your existing infrastructure to make it more accessible and useful for everyone who interacts with your data.

What's in a supergraph?

Every supergraph uses an open architecture called Apollo Federation, which consists of the following parts:

  • A graph router (also known as a gateway)
    • The graph router serves as the client-accessible entry point to your supergraph. It receives all incoming queries.
    • As its name suggests, the graph router "routes" each incoming query to the appropriate combination of subgraphs (see the next item). It's also responsible for combining multiple subgraph responses into a single response for the client.
  • One or more subgraphs
    • Each subgraph is itself a GraphQL API that's responsible for populating a subset of your supergraph's available data.
    • Usually, each of your existing backend services acts as a different subgraph.
  • Backing data sources (databases, REST APIs, etc.)
    • Your subgraphs use these to populate data for incoming queries.

The diagram at the top of this page shows a basic supergraph with two subgraphs and two corresponding data sources.

The following video provides a helpful visualization of how the Apollo Federation architecture works:

What are the benefits of a supergraph?

Adopting a supergraph significantly improves the developer experience for every team (both internal and external) that interacts with your organization's data. These improvements enable developers to ship products and features more quickly, with greater confidence in their reliability and performance.

How do I implement a supergraph?

To implement a supergraph, you set up its individual parts: the graph router and your subgraphs. Apollo provides libraries and tools for setting up each part. And more importantly, we provide tutorials to help you!

Tutorials

  • If you're new to GraphQL, we recommend starting your supergraph journey with the Lift-off tutorial series.
    • Familiarizing yourself with fundamental GraphQL concepts is an important prerequisite to getting the most out of your supergraph.
  • If you're already using GraphQL, learn how to implement a supergraph by completing the Voyage tutorial series.
    • This series demonstrates creating a supergraph from scratch, along with converting an existing monolithic GraphQL server into a supergraph.

Implementing the graph router

Apollo provides two libraries that can act as your graph router:

  • The Apollo Router
    • This is a high-performance binary written in Rust that adds minimal latency to request processing, even with extremely high traffic.
    • 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. All it needs is a configuration file for any behavior you want to customize.
  • Apollo Server with @apollo/gateway
    • This is Apollo's open-source Node.js GraphQL server library, which you can configure to act as a supergraph gateway.

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.

Implementing subgraphs

Each subgraph is itself a GraphQL API. Therefore, it uses a GraphQL server library to handle queries forwarded along by your graph router.

To act as a subgraph, a GraphQL server library needs to support the Apollo Federation subgraph specification. Fortunately, many popular libraries do!

  • Apollo Server with @apollo/subgraph
    • This is Apollo's open-source Node.js GraphQL server library, which you can configure to act as a subgraph.
    • Apollo Server supports a variety of popular Node.js middleware, and it works seamlessly with TypeScript.
  • Any of the other server libraries listed in Subgraph-compatible server libraries
    • Note that not all listed libraries support all parts of the subgraph specification.

Feel free to use whichever server library best suits your organization. Different subgraphs can even use completely different libraries, which is helpful if your various backend services use different languages.

How do I manage my supergraph?

By unifying your infrastructure with a supergraph, you also unlock unified tooling that provides visibility into the flow of data across your entire organization.

Apollo Studio is Apollo's cloud-based collection of tools for managing every aspect of your supergraph. Studio is essential to measuring your supergraph's performance, controlling access to it, and evolving it safely.

Free Apollo Studio features

The Apollo Studio Free plan provides the following supergraph management features to every organization:

  • The schema registry, which tracks the history of all your GraphQL schemas (for both individual subgraphs and your entire supergraph). The schema registry powers many of the other Studio features listed below.

  • Automatic, zero-downtime updates to your graph router's schema and other configuration, as part of a toolset called managed federation.

  • The Explorer, a powerful GraphQL IDE that helps your team (and other teams) build and run queries against your supergraph. You can even embed the Explorer on your own website, like this!

  • Metrics reporting for up to the last 24 hours (paid plans can view metrics for larger time frames):

    Studio Explorer tab
  • Schema checks, which enable you to verify whether proposed changes to your supergraph will cause issues with any existing client applications:

    Schema checks results in Studio
  • Team collaboration and access management via organizations.

  • Slack notifications for schema changes and daily metrics reports.

These Studio features are available to organizations with a paid Studio plan. Some features are available exclusively to an Enterprise plan.

How do clients query my supergraph?

To client applications, your supergraph appears the same as any other GraphQL API. Therefore, they query it with the same client libraries!

Apollo provides GraphQL client libraries for the following platforms:

These are all customizable, open-source libraries with powerful caching and state management features. Client-side caching enables an application to locally replicate the parts of your supergraph that it cares about. The application can then query itself for data if it's already present, which dramatically improves performance by eliminating redundant network requests.

How do I get started?

We have loads of helpful resources to help you start your supergraph journey:

Looking for additional guidance? Share a question in our community forums and we'll help point you in the right direction!

Edit on GitHub
Previous
Home
Next
Why adopt GraphQL?