Router Configuration Overview

Overview and reference for router configuration


Running an Apollo Router instance involves two key steps:

  • Configuring runtime features declaratively in YAML

  • Setting the supergraph schema for your router

Configuring features in YAML

Configuring the router's features happens primarily via a YAML configuration file. Named router.yaml by default, the router's YAML configuration file lets you configure all of a router's runtime features declaratively.

See Router YAML Configuration for more information.

Setting the supergraph schema

The router needs to know the supergraph schema for the graph it's running.

The router supports several methods for setting the supergraph schema, each suited for different deployment scenarios.

Graph artifactsKubernetes OperatorLocal filesUplink
Versioned, immutable schemas
Deterministic deployments
Blue/green deployment support
Works with any infrastructure
Automatic schema updates
No network dependency

Graph artifacts

Use graph artifacts for production deployments where you want immutable, versioned schema references with reliable rollbacks to any previous version.

To set graph artifacts as the supergraph schema for your router, use the --graph-artifact-reference command line option or APOLLO_GRAPH_ARTIFACT_REFERENCE environment variable.

Bash
1./router --graph-artifact-reference="artifact.api.apollographql.com/my-graph@sha256:6c3c62..."
Bash
1APOLLO_GRAPH_ARTIFACT_REFERENCE="artifact.api.apollographql.com/my-graph@sha256:6c3c62..." router

See Graph Artifacts for more information.

Apollo GraphOS Operator for Kubernetes

Use the Kubernetes Operator for Kubernetes-native schema management with automatic updates and built-in blue/green deployment support.

See the Apollo GraphOS Operator for more information.

Local schema files

Use local schema files for local development, testing, or production deployments where you manage schema files directly (often combined with CI/CD pipelines).

To set local schema files as the supergraph schema for your router, use the --supergraph command line option or APOLLO_ROUTER_SUPERGRAPH_PATH environment variable.

Bash
1router --supergraph ./supergraph.graphql
Bash
1APOLLO_ROUTER_SUPERGRAPH_PATH=./supergraph.graphql router

For zero-downtime schema updates with local files, enable hot reload.

Use Apollo Uplink when application teams don't have access to infrastructure and want automatic schema updates without manual deployment steps.

To set Apollo Uplink as the supergraph schema for your router, use the APOLLO_GRAPH_REF environment variable.

Bash
1APOLLO_GRAPH_REF="..." router

See Apollo Uplink for more information.

Feedback

Edit on GitHub

Ask Community