BUILT WITH RUST / FEDERATION v2

Many services.
One graph.

Your gRPC stack. A GraphQL experience.

Turn your protobuf definitions into a unified GraphQL API.
Queries, mutations, and real-time updates.
Without the handwritten resolvers.

$cargo add grpc_graphql_gateway

◇ Open source. Rust powered. MIT licensed.

DIFFERENT SERVICES. SHARED POSSIBILITIES.
Usersusers.proto
Productsproducts.proto
Ordersorders.proto
THE CONNECTION
Gateway.POWERED BY RUST
GraphQLONE ENDPOINT
.proto in → GraphQL out { }
YOUR INFRASTRUCTURE. A NEW PERSPECTIVE.
0
Handwritten resolversYour protobuf is the source
3↗
GraphQL operationsQuery. Mutate. Subscribe.
v2
Apollo FederationOne connected supergraph
MIT
Open sourceYours to build with
KEEP YOUR STACK. EXPAND WHAT’S POSSIBLE.

Less plumbing.
More possibilities.

Your services already do the hard work.
Give them a flexible API that’s a pleasure to use.

01

Your proto is the plan.

Generate a typed GraphQL schema directly from annotated protobuf descriptors. Keep your service definitions in one place.

From proto to GraphQL
02

Better, together.

Bring your services into an Apollo Federation v2 supergraph. Resolve entities efficiently with built-in DataLoader batching.

Connect your supergraph
03

Made for the live web.

Map server streams to subscriptions, or keep results fresh with live queries. Real-time experiences, powered by your gRPC services.

Keep your clients in sync
ONE GATEWAY. EVERY OPERATION.

Looks like GraphQL.
Works with gRPC.

A small annotation. A whole new interface.
Explore the connection, one operation at a time.

ASK FOR EXACTLY WHAT YOU NEED

Your RPC. A GraphQL query.

Annotate a protobuf method and let the gateway generate the schema. Your clients choose the fields. Your gRPC service does the work.

Unary RPCGenerated schemaTyped responses
Read the guide
user.proto
// Add to your annotated UserServicerpc GetUser(GetUserRequest) returns (User) {  option (graphql.schema) = {    type: QUERY    name: "user"  };}
EXPOSED AS GRAPHQL
query.graphql
query GetUser {  user(id: "123") {    id    name    email  }}
INTERACTIVE EXAMPLE

Real examples, from the gateway documentation.Also supports file uploads and @defer

READY FOR WHAT COMES NEXT.

A small bridge.
Built for serious traffic.

Rust at the core. Practical controls at the edges.
The building blocks your production stack needs.

A FEW LINES. A NEW WAY IN.

From service
to schema.

Your first gateway starts here.
Bring a gRPC service. We’ll make the connection.

  1. 01

    Add the crate

    A small addition to your Rust project.

  2. 02

    Prepare your descriptors

    Annotate your proto and compile with protoc.

  3. 03

    Start your gateway

    Connect your backend. Meet your GraphQL API.

Follow the complete quick start
main.rs
use grpc_graphql_gateway::{Gateway, GrpcClient}; #[tokio::main]async fn main() -> Result<(), Box<dyn std::error::Error>> {    Gateway::builder()        .with_descriptor_set_file("descriptor.bin")?        .add_grpc_client(            "greeter.Greeter",            GrpcClient::builder("http://localhost:50051")                .connect_lazy()?,        )        .build()?        .serve("0.0.0.0:8888")        .await?;     Ok(())}
Next stop: localhost:8888/graphql

Requires a running Greeter gRPC backend and descriptor.bin.
Start with the descriptor guide to generate it.

BUILT IN THE OPEN. BETTER CONNECTED.

Your next connection
starts here.

Build something useful. Make your services go further.
Help shape what comes next for the gateway.

gRPC–GraphQL Gateway v1.2.5 · Made with Rust & a love of good APIs.
↑ ↓ navigate ↵ openDocumentation, at your fingertips.