⬡ GraphQL Intermediate

What is a GraphQL gateway?

Answer

A GraphQL gateway is a server that acts as the single entry point for clients, aggregating data from multiple downstream GraphQL services (or REST/gRPC services) and presenting a unified schema. The gateway handles: schema composition (merging subgraphs), query planning (splitting a query across multiple services), result merging (combining responses into one), cross-cutting concerns (auth, rate limiting, logging). Apollo Router is the production-grade gateway for Federation v2 (written in Rust for performance). GraphQL Mesh can serve as a gateway wrapping REST, gRPC, SOAP, and GraphQL services. The gateway pattern enables micro-frontend/microservice architectures where each team owns their service but clients see one clean API. The query planner optimizes which services to call and in what order based on field dependencies.