Router Environment Variable Configuration Reference
This reference covers the environment variables for configuring an Apollo Router.
Environment variables
This section lists and describes the environment variables you can set when running the router
binary.
tip
These environment variables apply only if your supergraph schema is managed by GraphOS.
Environment Variable | Description |
---|---|
| The graph ref for the GraphOS graph and variant that the router fetches its supergraph schema from (e.g., docs-example-graph@staging ).Required when using managed federation, except when using an offline license to run the router. |
| The graph API key that the router should use to authenticate with GraphOS when fetching its supergraph schema.Required when using managed federation, except when using an offline license to run the router or when using APOLLO_KEY_PATH . |
| ⚠️ This is not available on Windows.A path to a file containing the graph API key that the router should use to authenticate with GraphOS when fetching its supergraph schema.Required when using managed federation, except when using an offline license to run the router or when using APOLLO_KEY . |
Example command
To use environment variables when running router, you must set them before the router
command:
Bash
1APOLLO_KEY="..." APOLLO_GRAPH_REF="..." ./router