Docs
Launch GraphOS Studio

Routing for supergraphs

Learn about self-hosted and cloud routing options


With architecture (also known as Apollo Federation), each component service is known as a subgraph. A router acts as an entry point to your s and provides a unified interface for clients to interact with. Clients send s to your 's public endpoint instead of directly to your APIs.

Clients
Router
Subgraph A
Subgraph B

The intelligently executes each incoming client across the appropriate combination of s. It then merges subgraph responses into a single response for the client. You can configure your router's error handling, CORS settings, other security features, and more. Your configuration options depend on your router type.

Router types

With , you can host your own Apollo , a configurable, high-performance routing runtime packaged as a standalone binary:

Your infrastructure
Router
Subgraph A
Subgraph B
Clients

Or you can choose for Apollo to provision and manage a cloud router for you:

Your infrastructure
Apollo Cloud
Subgraph A
Subgraph B
Router
Clients

Cloud s use the same Apollo Router binary that you can self-host.

If you use a cloud , you can choose to run it on shared or dedicated infrastructure. Running it on dedicated infrastructure offers more configuration options. Continue reading for a more detailed comparison of your router options.

Router comparison

Apollo offers the following options, in increasing order of configurability:

Router typeDescriptionConfigurabilityPlan availability
Cloud shared routerApollo provisions and manages routers on shared infrastructure.Basic configurability, including HTTP header rules, CORS settings, and subgraph error inclusionServerless
Cloud Dedicated routerApollo provisions and manages routers on dedicated infrastructure that you control and scale.Highly configurable, including all options for shared cloud routers and additional configurationsDedicated
Self-hosted routerYou host and manage the router on your own infrastructure.Highly configurable and customizable, including all options for Cloud Dedicated routers and additional customization optionsApollo Router is available as a free and source-available runtime. Connecting your self-hosted Router to GraphOS requires an Enterprise plan.

Somes organizations might need to use Cloud Dedicated or self-hosted routing instead of shared cloud routing for these reasons:

  • Compliance. All of your 's components must be hosted in a particular region to adhere to compliance requirements.
  • Performance. You need to minimize latency between your and s by enabling them to communicate without traversing the public internet, for example by hosting all components in a VPC.
  • Customization. You need to configure or customize your 's behavior beyond what's available on shared infrastructure.

With the exception of Apollo-managed routing, self-hosted s benefit from all of the same features as cloud supergraphs: metrics reporting, , the , etc.

If you are interested in either Cloud Dedicated or self-hosted routing, don't hesitate to get in touch.

Setup and configuration

For setup and configuration instructions, refer to the respective documentation:

Previous
Safelisting with persisted queries
Next
Self-hosted routing
Edit on GitHubEditForumsDiscord