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.
Previous
What is schema stitching in GraphQL?
Next
What is the Apollo Cache and how does normalized caching work?
More GraphQL Questions
View all →- Intermediate How do you implement pagination in GraphQL?
- Intermediate What is the Relay specification in GraphQL?
- Intermediate How do you implement authorization in GraphQL resolvers?
- Intermediate What is graphql-shield and how does it work?
- Intermediate How do you implement real-time subscriptions with GraphQL?