Skip to content

🧘 Rewrite of a fully-featured GraphQL Server with focus on easy setup, performance & great developer experience. The core of Yoga implements W3C Fetch API and can run/deploy on any JS environment.

License

master
Switch branches/tags
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
Dec 10, 2021

GraphQL Yoga

Fully-featured GraphQL Server with focus on easy setup, performance & great developer experience

Read the 2.0 announcement blog post Read the docs

Installation

npm i @graphql-yoga/node graphql

Basic Usage

This is a very simple example of how to use it:

const { createServer } = require('@graphql-yoga/node')

// Provide your schema
const server = createServer({
  schema: {
    typeDefs: `
      type Query {
        ping: String
      }
    `,
    resolvers: {
      Query: {
        ping: () => 'pong',
      },
    },
  },
})

// Start the server and explore http://localhost:4000/graphql
server.start()

Overview

  • Easiest way to run a GraphQL server: Sensible defaults & includes everything you need with minimal setup (we also export a platform/env-agnostic handler so you can build your own wrappers easily).
  • Includes Subscriptions: Built-in support for GraphQL subscriptions using Server-Sent Events.
  • Compatible: Works with all GraphQL clients (Apollo, Relay...) and fits seamless in your GraphQL workflow.
  • WHATWG Fetch API: the core package depends on WHATWG Fetch API so it can run and deploy on any environment (Serverless, Workers, Deno, Node).
  • Easily Extendable: New GraphQL-Yoga support all envelop plugins.

Features

  • GraphQL spec-compliant
  • TypeScript
  • File upload
  • Realtime capabilities
  • Accepts both application/json and application/graphql content-types
  • Supports ESM
  • Runs everywhere: Can be deployed via now, up, AWS Lambda, Heroku etc.

Contributing

If this is your first time contributing to this project, please do read our Contributor Workflow Guide before you get started off.

Feel free to open issues and pull requests. We're always welcome support from the community.

Code of Conduct

Help us keep Yoga open and inclusive. Please read and follow our of Conduct as adopted from Contributor Covenant

License

GitHub license

MIT

About

🧘 Rewrite of a fully-featured GraphQL Server with focus on easy setup, performance & great developer experience. The core of Yoga implements W3C Fetch API and can run/deploy on any JS environment.

Topics

Resources

License

Stars

Watchers

Forks