Skip to content
This repository has been archived by the owner on Oct 17, 2020. It is now read-only.

Latest commit

 

History

History
78 lines (55 loc) · 2.61 KB

01-Overview.md

File metadata and controls

78 lines (55 loc) · 2.61 KB

Overview

Prisma

Description

GraphQL Yoga is a fully-featured GraphQL Server with focus on easy setup, performance & great developer experience.

Features

  • Easiest way to run a GraphQL server: Sensible defaults & includes everything you need with minimal setup.
  • Includes Subscriptions: Built-in support for realtime 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:

Features

  • GraphQL spec-compliant
  • File uploadgit st
  • GraphQL Subscriptions
  • TypeScript typings
  • GraphQL Playground
  • Extensible via Express middlewares
  • Query Performance Tracing (via Apollo Tracing)
  • Accepts both application/json and application/graphql content-type
  • Runs everywhere: Can be deployed via now, up, AWS Lambda, Heroku etc

Install

Install with npm:

npm install graphql-yoga --save

Install with yarn:

yarn add graphql-yoga

Quickstart

import { GraphQLServer } from 'graphql-yoga'
// ... or using `require()`
// const { GraphQLServer } = require('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:4000'))

See here for more examples and use cases.

Workflow

Once your graphql-yoga server is running, you can use GraphQL Playground out of the box – typically running on localhost:4000. (Read here for more information.)