Launch Week Day 5: Introducing Reachability for PHP.Learn More
Socket
Book a DemoSign in
Socket

graphql-yoga

Package Overview
Dependencies
Maintainers
1
Versions
4484
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-yoga

Source
npmnpm
Version
0.0.7
Version published
Weekly downloads
1.1M
6.8%
Maintainers
1
Weekly downloads
 
Created
Source

graphql-yoga

Build Status npm version Greenkeeper badge

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

Quickstart (Hosted demo)

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: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

Keywords

graphql

FAQs

Package last updated on 15 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts