Open Source Alternative to Apollo Router
Hive Router is an MIT-licensed GraphQL Federation router in Rust and an alternative to Apollo Router. See what maps to what and how to try it side by side.
Hive Router is an open-source alternative to Apollo Router. Both are GraphQL Federation routers written in Rust, and both serve the same supergraph schema, so switching does not touch your subgraphs or your composition pipeline.
Why Teams Switch
- MIT license. Hive Router is MIT licensed. Apollo Router is distributed under the Elastic License 2.0.
- One edition, all features. Subscriptions, JWT authentication, authorization directives, persisted documents, demand control, coprocessors and telemetry work without a license key.
- Performance you can verify. The Federation Gateway Performance benchmark compares Hive Router with Apollo Router and other gateways under the same load. The benchmark is open source, so you can rerun it on your own hardware.
- Compatibility you can verify. The Federation Gateway Audit runs one test suite against every gateway and publishes the results live. Hive Router passes every test case.
- Any registry. Hive Router loads the supergraph from Hive Console, Apollo GraphOS, a file or an S3-compatible bucket.
What Maps to What
| In Apollo Router | In Hive Router |
|---|---|
router.yaml | router.config.yaml and environment variables |
| Supergraph from GraphOS Uplink or a file | Supergraph sources: Hive Console, Apollo GraphOS, a file, S3-compatible storage |
| Rhai scripts | Expressions in configuration |
| Native Rust plugins | Rust plugin system |
| External coprocessors | Coprocessors |
| JWT authentication | JWT authentication |
@authenticated, @requiresScopes | Authorization directives |
@policy | Custom authorization policies |
| Persisted queries and safelisting | Persisted documents, with app deployments in Hive Console |
| Demand control | Demand control with @cost and @listSize |
| Operation limits | Operation complexity limits |
| Subscriptions | Subscriptions over SSE, WebSockets, multipart HTTP and HTTP callbacks |
| Traffic shaping | Traffic shaping: deduplication, timeouts, compression, circuit breakers |
| Header propagation | Header manipulation |
| Subgraph URL overrides | Dynamic subgraph routing |
Progressive @override | Override labels |
@context and @fromContext | Contextual arguments |
| OpenTelemetry, Prometheus, Datadog | Tracing, metrics, logging |
| Health checks | Health and readiness probes |
| TLS | TLS and mutual TLS |
| CORS and CSRF prevention | CORS and CSRF prevention |
| Usage reporting to GraphOS | Usage reporting to Hive Console |
The configuration files are not compatible with each other. The concepts are close, so most settings have a direct counterpart in the configuration reference.
Try It Next to Apollo Router
You can run Hive Router against the supergraph you already publish to Apollo GraphOS, without changing how you publish schemas.
1. Install
Or pull the Docker image, ghcr.io/graphql-hive/router.
2. Point it at your supergraph
Use the graph ref and an API key of the graph you already have:
Or load the supergraph file your pipeline already produces:
3. Run it and compare
Hive Router listens on port 4000 by default, the same as Apollo Router, so this starts it on
4001 and both can run on one machine. Send it the operations your clients send today and
compare responses, latency and resource usage with your current router. When you are ready, move the
settings you rely on across with the table above, starting with
header rules,
authentication and
telemetry.
Moving the Registry Too
Hive Router does not need Hive Console. If you also want an open-source schema registry with schema checks, usage insights and persisted documents, see Hive as an alternative to Apollo GraphOS.
Frequently Asked Questions
Do I need to change my subgraphs?
No. Hive Router consumes a standard Apollo Federation v2 supergraph. Your subgraphs and your composition step stay as they are.
Can I keep publishing schemas to Apollo GraphOS?
Yes. Set supergraph.source to apollo_graphos and Hive Router polls the same Uplink endpoint that
Apollo Router uses. See supergraph sources.
How do I port Rhai scripts and plugins?
Header rules, routing decisions and feature flags that are written as Rhai scripts usually become expressions in the configuration file. Logic that needs code moves to a Rust plugin compiled into the router, or to a coprocessor in any language.
Is there a TypeScript option?
Yes. Hive Gateway is written in TypeScript and can run the Hive Router query planner as a native addon. See Hive Router or Hive Gateway.