Hive Router
The open-source GraphQL Federation router written in Rust. Serve your supergraph with native performance.
- MIT licensed
- Drop-in for Apollo Router
- Binary or Docker image
- 199/199Federation audit test cases passed
- ~6×the throughput of Apollo Router
- ~48 msp95 latency at 50 concurrent users
- ~49 MBpeak memory under load
Benchmark figures are from our open Federation gateway benchmark on a 4 vCPU Azure VM with 50 virtual users. Rerun it yourself: every gateway, query and subgraph is in the repository.
Why Hive Router
Everything a production federation router needs, in one binary, with no license tiers.
- Built in Rust, no garbage collection
- Arena allocation, zero-copy JSON and no garbage collector. Latency stays flat under load.
- Learn more
- Full Apollo Federation compatibility
- Point it at your existing supergraph. Every release is checked against our open Federation audit, including @defer, @stream and progressive overrides.
- Learn more
- Observability built in
- OpenTelemetry traces, Prometheus metrics, structured logs and health probes. Send them to Hive Console, Grafana, Datadog or any compatible backend.
- Learn more
- Security at the edge of your graph
- JWT authentication, authorization directives, demand control, persisted documents, CSRF and CORS protection. One YAML file configures all of it.
- Learn more
- Federated subscriptions
- Real-time data over Server-Sent Events, WebSockets or multipart HTTP. Entities are resolved across subgraphs for subscription events too.
- Learn more
- Works with any registry
- Load the supergraph from a file, Hive Console or Apollo GraphOS and reload it on change. Hive Console is optional.
- Learn more
From zero to a running supergraph in three steps
No runtime to install, nothing to compile. Bring a supergraph schema and the router serves it on port 4000, with a GraphQL IDE included.
Full getting started guide- 1
Install
Downloads the binary for Linux or macOS. For containers, pull ghcr.io/graphql-hive/router.
curl -o- https://raw.githubusercontent.com/graphql-hive/router/main/install.sh | sh - 2
Point it at your supergraph
This is the whole config for a local file. Hive Console and Apollo GraphOS work as sources too.
supergraph: source: file path: ./supergraph.graphql - 3
Run it
Serves your supergraph on port 4000.
./hive_router
Federation-Compatible Gateway Benchmarks
See the results of our open-source audit for Apollo Federation Gateways.
Learn how Hive Router performs against other gateways in terms of correctness and compliance with the Apollo Federation specification
Learn about our audit and methodologyMake it yours
Extend the router, lock down what runs through it and keep your subgraphs safe.
Explore Hive 360° GraphQL Ecosystem to reach full potential
Learn moreFrequently Asked Questions
Hive Router or Hive Gateway, which one should I pick?
Both are open source and actively maintained. Hive Router is written in Rust for high throughput and low resource usage. Hive Gateway is written in TypeScript and runs on Node.js and other (serverless) JavaScript runtimes. Gateway provides more flexibility for teams that are already familiar with TypeScript. Both can serve a supergraph from a local file or a schema registry, such as Hive Console.
Can I replace Apollo Router without changing my subgraphs?
Yes. Hive Router consumes a standard Apollo Federation supergraph, so you keep your subgraphs and your composition pipeline and only swap the binary, while re-using your existing supergraph from a local file or even GraphOS. See the compatibility overview for the directives and features covered, and the getting started guide.
Does Hive Router support GraphQL subscriptions?
Yes. Federated subscriptions are built in, over Server-Sent Events, WebSockets or multipart HTTP. The protocol between the router and each subgraph can be configured individually. Read more.
How do I extend the router?
There are two ways to extend Hive Router. Plugins are written in Rust and compiled into the router. Coprocessors are external HTTP services in any language that the router calls. Both support hooking into the HTTP, GraphQL, query planning and execution stages of a request.
How does Hive Router integrate with my monitoring stack?
It emits OpenTelemetry traces and Prometheus metrics, which you can send to Hive Console or any compatible backend, such as Datadog or Grafana, alongside structured logs, health and readiness probes. Furthermore, schema usage metrics can be sent to a schema registry such as Hive Console or GraphOS. Read more.
Do I need Hive Console to use Hive Router?
No. Hive Router is a standalone binary that can load a supergraph file and other sources such as Hive Console or Apollo GraphOS. Using Hive Console is fully optional and provides additional features such as a place to manage your supergraph, publish persisted documents and collect metrics. Read more.
Are all Hive Router features open source?
Yes. Hive Router is MIT licensed. Every feature ships in the same binary, with no license tiers. Read more.
Get your
API game right.
- Built by engineers to improve developer experience
- Driven by customers
- No vendor lock-in