The High-Performance GraphQL Federation Platform for Mission-Critical APIs
Website • Documentation • CLI • Community • Blog
Grafbase is a self-hosted, Rust-powered GraphQL Federation Gateway designed for high-scale, mission-critical applications. Whether you're unifying microservices, legacy systems, or third-party APIs—Grafbase helps teams ship faster and more safely.
- Federation-first architecture — Native support for Apollo Federation v2 specification and the upcoming Composite Schemas spec
- 40% faster performance — Rust-powered engine delivers superior speed
- Extensible via WebAssembly — Customize authentication, authorization, request lifecycle, and include arbitrary APIs and data sources into your federated graph with resolver extensions
- AI-native with MCP — First GraphQL gateway with built-in Model Context Protocol server support to turn your GraphQL API into a full fledged MCP server
Grafbase delivers up to 40% faster response times vs Apollo and other gateways with lower memory usage and CPU consumption. Built in Rust for maximum efficiency.
- Advanced schema governance with the Grafbase Dashboard at app.grafbase.com, with schema checks
- Fine-grained authorization and authentication in the Gateway
- Rate limiting, operation limits, and trusted documents
- SOC 2 Type II compliant
- Self-hosted: Full control in your infrastructure
- Managed Cloud: Grafbase-hosted
- Air-gapped: Offline deployments for high-security environments
The Gateway itself is always 100% self hosted.
Connect any data source through GraphQL Federation:
- GraphQL subgraphs
- REST APIs
- gRPC services
- Databases (Postgres, Snowflake)
- Message queues (Kafka, NATS)
- Custom protocols and data sources via WebAssembly extensions
Core features
| Apollo Federation v2 | Native support for Apollo Federation v2 spec | | Rust-Powered Gateway | Ultra-low latency and memory efficiency at enterprise scale | | Extensions | Customize auth, transforms, and business logic without gateway modifications | | Schema Governance Platform | Composition checks, breaking change detection, and approval workflows with schema proposals (in the control plane) | | Branch Environments Platform | Schema versioning and branch-aware development environments (in the control plane) | | CLI & Gateway | Complete toolchain for development, deployment, and management | | MCP Integration | Built-in Model Context Protocol support to efficiently expose your GraphQL API as an MCP server with a few lines of configuration | | Observability (in the Platform) | Traces, metrics, logs, and operation analytics |
This repository contains the core open source components of Grafbase: the CLI, the Gateway and supporting libraries. See the grafbase/extensions repository for our open source extensions.
Get started quickly with Grafbase by following our getting started guide.
Explore real-world implementations and integration patterns in our examples directory:
Learn more:
- gRPC Services - Protocol Buffer service integration
- WASM Extensions - Custom authentication, authorization, resolvers and request lifecycle hooks
Grafbase supports powerful customization via WebAssembly extensions:
# Create a custom authentication extension grafbase extension init --type authentication auth-guard cd auth-guard # Build and install grafbase extension build grafbase extension install
Extension Use Cases:
- Custom Authentication - JWT validation, API key management
- Custom Authorization- implement arbitrary authorization business logic, declaratively requiring data from the graph
- Arbitrary resolvers — plug your non-GraphQL APIs and data sources in your federated graph without writing and deploying any additional GraphQL server
- Observability Hooks - Custom logging and metrics collection
- Rate Limiting - Advanced throttling and quota management
Learn more: Extension SDK Documentation
#
Grafbase consistently outperforms other GraphQL Federation gateways:
Metric | Grafbase | Apollo Router | Cosmo Router |
---|---|---|---|
Response Time | ✅ Baseline | 🟡 Slower | 🟡 Slower |
Memory Usage | ✅ Efficient | 🔴 High | 🟡 moderate |
Cold Start | ✅ Fast | 🟡 Slower | 🟡 Slower |
Throughput | ✅ High | 🟡 Moderate | 🟡 Moderate |
See detailed benchmarks comparing Grafbase vs Apollo vs Cosmo vs Hive in our performance analysis.
To install the Grafbase Gateway, run the following command:
curl -fsSL https://grafbase.com/downloads/gateway | bash
Hybrid Mode (Connected to Grafbase Cloud): Start the gateway in hybrid mode with the graph reference and an organization access token:
GRAFBASE_ACCESS_TOKEN=token ./grafbase-gateway \ --config grafbase.toml \ --graph-ref graph@branch
Air-gapped Mode (Fully self-contained): Start the gateway in air-gapped mode with a local schema file:
./grafbase-gateway \ --config /path/to/grafbase.toml \ --schema /path/to/federated-schema.graphql \ --listen-address 127.0.0.1:4000
Docker Deployment:
docker run -p 4000:4000 \ -v $(pwd)/grafbase.toml:/etc/grafbase.toml \ -v $(pwd)/schema.graphql:/etc/schema.graphql \ ghcr.io/grafbase/gateway:latest \ --config /etc/grafbase.toml \ --schema /etc/schema.graphql
- JWT authentication and federated authorization
- Rate limiting, operation limits, and trusted documents
- Entity caching and automatic persisted queries
- Health check endpoints and request lifecycle hooks
- OpenTelemetry integration for logs, traces, and metrics
- … and many more
Community & contributing
We welcome contributions from the community! Here's how to get involved:
- Join our Discord - Real-time community support
- Report Issues - Bug reports and feature requests
- Documentation - Comprehensive guides and API reference
- Fork the repository and create a feature branch
- Read our Contributing Guide - Development setup and guidelines
- Submit a Pull Request - We review all contributions promptly
- Join our Discord - Connect with maintainers and contributors
- Bug fixes and performance improvements
- Documentation improvements and examples
- Extensions for new data sources and protocols
- Testing and quality assurance
- Developer experience enhancements
Grafbase Gateway is licensed under the Mozilla Public License 2.0 (MPL-2.0).
- Official Documentation - Complete API reference and guides
- GraphQL Federation Guide - Learn federation concepts
- Migration from Apollo - Switch from Apollo Federation
- Grafbase CLI - Command-line interface and tooling
- Gateway Documentation - Self-hosted deployment guide
- Benchmarks & Analysis - Performance comparisons