| title | Supergraph Routing with GraphOS Router | |
|---|---|---|
| subtitle | Learn the basics about router features and deployment types | |
| description | Apollo provides cloud and self-hosted GraphOS Router options. The router acts as an entry point to your GraphQL APIs and provides a unified interface for clients to interact with. | |
| redirectFrom |
|
GraphOS Router is the runtime of the GraphOS platform. It executes client operations by planning and executing subgraph queries, then merging them into client responses. It's also the single entry point and gateway to your federated GraphQL API.
As the runtime of the GraphOS platform, a GraphOS Router gets the supergraph schema—the blueprint of the federated graphs—from the GraphOS control plane. It then executes incoming clients operations based on that schema.
Unlike API gateways that offer capabilities to manage API endpoints, the router isn't based on URLs or REST endpoints. Rather, the router is a GraphQL-native solution for handling client APIs.
Whenever your router receives an incoming GraphQL operation, it needs to figure out how to use your subgraphs to populate data for each of that operation's fields. To do this, the router generates a query plan:
A query plan is a blueprint for dividing a single incoming operation into one or more operations that are each resolvable by a single subgraph. Some of these operations depend on the results of other operations, so the query plan also defines any required ordering for their execution. The router's query planner determines the optimal set of subgraph queries for each client operation, then it merges the subgraph responses into a single response for the client.
You can use the following tools for inspecting query plans:
- Use the Explorer IDE to view dynamically calculated example query plans for your operations in its right-hand panel.
- Use the Apollo Solutions command line utility for generating a query plan locally.
The GraphOS Router is the gateway and entry point to a federated supergraph. Clients send GraphQL operations to your router's public endpoint instead of directly to your APIs.
As the entry point to your supergraph, a GraphOS Router must be able to process the expected load of client operations. The scalability and performance of a router, or a fleet or router instances, can be influenced by their deployment infrastructure.
You can choose for Apollo to provision and manage the runtime infrastructure for your routers. Apollo hosts and deploys each instance of router in the cloud. Each cloud-hosted router instance is fully integrated and configurable within GraphOS.
While cloud routers are hosted in the cloud, GraphQL subgraph servers are still hosted in your infrastructure.
You can choose to manage the runtime infrastructure for your routers by yourself. Using container images of router, you can host and deploy your router instances from your own infrastructure. These self-hosted router instances allow you full control over their deployment.
Self-hosted routers running on the Free plan are rate limited to 60 requests per minute.
For requests in excess of this limit, the router returns an HTTP 503 (Service Unavailable) response.
Both cloud-hosted and self-hosted routers are powered by the Apollo Router Core—a high-performance router packaged as a standalone binary.
Apollo offers the following router options, in increasing order of configurability:
| Router type | Description | Configurability | Plan availability |
|---|---|---|---|
| Shared cloud router | Apollo provisions and manages routers on shared infrastructure. | Basic configurability, including HTTP header rules, CORS settings, and subgraph error inclusion | Serverless** |
| Dedicated cloud router | Apollo provisions and manages routers on dedicated infrastructure that you control and scale. | Highly configurable, including all options for shared cloud routers and additional configurations | Dedicated** |
| Self-hosted router | You host and manage the router on your own infrastructure. | Highly configurable and customizable, including all options for Cloud Dedicated routers and additional [customization options](/graphos/routing/customization/overview). | The Apollo Router Core is available as a free and source-available router. Connecting your self-hosted router to GraphOS requires a{" "} GraphOS plan. |
**We've paused new sign-ups for Serverless and Dedicated plans while we improve our offerings based on user feedback. This means cloud routing is temporarily unavailable to new users. In the meantime, you can explore other GraphOS features with our Free plan.
Although powered by the source-available Apollo Router Core binary, GraphOS Routers offer an expanded feature set that isn't available when running the Apollo Router Core without connecting it to GraphOS.
Cloud-hosted routers automatically have access to additional GraphOS Router features, while self-hosted routers must be authenticated with a GraphOS Enterprise license to gain access to these features. Refer to the pricing page to compare GraphOS Router features across plan types.
-
Learn more about deploying router instances in your own infrastructure in self-hosted router
-
Learn the basics about configuring a router in Configuring a Router
-
For all available configuration options, go to Router configuration reference docs
-
To learn more about the intricacies of query plans, see the example graph and query plan in reference docs
-
Learn more about Apollo-managed routers in cloud-hosted router