Hive Router

The most performant federation router in the ecosystem

Open source and written in Rust. Highest throughput, lowest latency and lowest memory in the open Federation gateway benchmark, with a perfect score on the Federation audit.

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. Federation v2.0 through v2.9 is covered, including @interfaceObject, progressive @override, @context and @fromContext, and every release is checked against our open Federation audit.
Learn more
Observability built in
OpenTelemetry traces, OTLP and Prometheus metrics, a native Datadog tracer, one structured log line per request and health probes. Send them to Hive Console, Grafana, Datadog or any OTLP backend.
Learn more
Security at the edge of your graph
JWT authentication, @authenticated, @requiresScopes and @policy, demand control, persisted documents, TLS and mutual TLS, subgraph error masking, 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, with HTTP callbacks and multiplexed WebSockets towards subgraphs. Entities are resolved across subgraphs for subscription events too.
Learn more
Works with any registry
Load the supergraph from a file, an S3-compatible bucket, 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. 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. 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. 3

    Run it

    Serves your supergraph on port 4000.

    ./hive_router
100%210 of 210 test cases across 48 suites

Compatible with Apollo Federation, checked on every release

Our open Federation audit runs the same test suite against every gateway in the ecosystem: entities, @interfaceObject, @requires, @provides, @override and the other Federation directives, plus the edge cases our users have hit in production. We run it continuously, so the results page is always current.

Make it yours

Extend the router with your own code and decide how traffic moves through it.

  • Rust Plugin System

    Plugins written in Rust and compiled into the router, with hooks into the HTTP, GraphQL, query planning and execution stages.

    Documentation
  • Coprocessors

    External HTTP services in any language. The router calls them at the same stages, no Rust required.

    Documentation
  • Dynamic Routing

    Route requests to a different subgraph instance per tenant, region or feature flag, and rewrite headers on the way through. A one-line expression in YAML, no code.

    Documentation
  • Traffic Shaping

    Deduplicate in-flight requests, trip a circuit breaker on a failing subgraph, tune timeouts and connection pools per subgraph and compress traffic in both directions.

    Documentation

One edition. All features.

Everything included, everything open source. No enterprise edition and no feature flags behind a license key.

Recently shipped

What the router team released most recently.

All product updates
  1. Anonymize Supergraphs and Operations with Hive Router
  2. Contextual Arguments with @context and @fromContext in Hive Router
  3. Native Datadog Tracing in Hive Router
  4. Custom Authorization Policies with @policy in Hive Router
  5. WebSocket Connection Multiplexing in Hive Router
  6. Logging in Hive Router

Explore Hive 360° GraphQL Ecosystem to reach full potential

Learn more

Frequently 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.

How does Hive Router compare to Apollo Router?

Both are Federation routers written in Rust, and both serve the same supergraph schema. Apollo Router is distributed under the Elastic License 2.0. Hive Router is MIT licensed and has one edition with every feature in it: subscriptions, persisted documents, authorization directives, demand control, coprocessors and telemetry need no license key and no paid plan. In our open gateway benchmark it has the highest throughput and the lowest latency and memory use of the gateways tested, and it passes every test case of the Federation audit. Both are open for you to rerun.

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.

Which Apollo Federation versions and directives does Hive Router support?

Federation v2, from v2.0 through v2.9. That covers @key, @requires, @provides, @shareable, @interfaceObject, @composeDirective, @authenticated, @requiresScopes, @policy, progressive @override, @context and @fromContext, and @cost and @listSize. Federation v1 supergraphs are not supported: compose your subgraphs with Federation v2, or use Hive Gateway, which serves both. Apollo Connectors and @cacheTag are not supported yet. See the compatibility table.

Does Hive Router support GraphQL subscriptions?

Yes. Federated subscriptions are built in. Clients connect over Server-Sent Events, WebSockets, multipart HTTP or Incremental Delivery over HTTP, and the router talks to each subgraph over the protocol you choose for it, including HTTP callbacks and multiplexed WebSockets. 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 metrics over OTLP, exposes a Prometheus scrape endpoint and has a native Datadog tracer, alongside structured logs with one summary line per request, and health and readiness probes. Send them to Hive Console, Grafana, Datadog or any OTLP backend. Schema usage reports go to Hive Console, where they drive breaking change detection based on real traffic. Read more.

Do I need Hive Console to use Hive Router?

No. Hive Router is a standalone binary that can load a supergraph from a file, an S3-compatible bucket, 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.

Can I use the Hive Router query planner from Node.js?

Yes. Hive Gateway can run the same Rust query planner as a native addon on Node.js, Bun and Deno, so you keep TypeScript plugins and still get the faster planner. 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