
graphql-yoga

Fully-featured GraphQL Server with focus on easy setup, performance & great developer experience
Features
- Easiest way to run a GraphQL server: Good defaults & includes everything you need with minimal setup.
- Includes Subscriptions: Built-in support for GraphQL Subscriptions using WebSockets.
- Compatible: Works with all GraphQL clients (Apollo, Relay...) and fits seamless in your GraphQL workflow.
graphql-yoga is based on the following libraries & tools:
Install
yarn add graphql-yoga
Usage
import { GraphQLServer } from './graphql-yoga'
const typeDefs = `
type Query {
hello(name: String): String!
}
`
const resolvers = {
Query: {
hello: (_, { name }) => `Hello ${name || 'World'}`,
},
}
const server = new GraphQLServer({ typeDefs, resolvers })
server.start(() => console.log('Server is running on localhost:3000'))
To get started with graphql-yoga, follow the instructions in the READMEs of the examples.
API
GraphQLServer
PubSub
Endpoints
Examples
Workflow

Deployment
now
up
Heroku
AWS Lambda
FAQ
How does graphql-yoga compare to apollo-server and other tools?
As mentioned above, graphql-yoga is built on top of a variety of other packages that each provide a certain piece of functionality required for building a GraphQL server. Instead of needing to install and configure each of these packages, graphql-yoga configures provides a sensible default configuration for them under the hood. graphql-yoga is the create-react-app for building GraphQL servers.
Can't I just setup my own GraphQL server using express?
- 80:20 rule
- create-react-app
- just "eject" when you need to