GraphQL Yoga is a full GraphQL server focused on simple setup and broad runtime support. It runs wherever the WHATWG Fetch API is available, from Node to serverless workers.
Overview
GraphQL Yoga is a GraphQL server implementation from The Guild aimed at quick setup, performance, and developer experience. The core uses the WHATWG Fetch API so the same handler can run on Node, Deno, Bun, Cloudflare Workers, AWS Lambda, and other JavaScript environments.
Defaults include GraphiQL, file uploads via the multipart request spec, subscriptions over Server-Sent Events, automatic persisted queries, and parsing and validation caching. It works with common GraphQL clients and supports Apollo Federation for supergraphs and subgraphs. Envelop plugins add authentication, caching, rate limiting, logging, metrics, and many other cross-cutting concerns.
Yoga follows current GraphQL over HTTP guidance and sits alongside other servers in the ecosystem. Features such as error masking, health checks, and persisted operations are built in or available through the plugin model.
Teams start a schema and Yoga instance on their chosen platform adapter, including Express, Fastify, Koa, NestJS, Next.js, and SvelteKit integrations. It can be self-hosted and is fully open source without vendor lock-in.
Key features
- WHATWG Fetch API core
- Built-in GraphiQL
- Subscriptions via Server-Sent Events
- GraphQL multipart file uploads
- Automatic persisted queries
- Apollo Federation support
- Envelop plugin ecosystem
- Validation and parse caching
Use cases
- GraphQL API on serverless workers
- Federated supergraph or subgraph hosting
- Single-server GraphQL with plugins
- Multi-runtime JavaScript GraphQL deployment
- GraphQL with SSE subscriptions