sub
@graphql-yoga/subscription
npm i @graphql-yoga/subscription
sub

@graphql-yoga/subscription

🧘 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.

by Dotan Simha

2.2.3 (see all)License:MITTypeScript:Built-In
npm i @graphql-yoga/subscription
Readme

GraphQL Yoga

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

Docs

Installation

npm i @graphql-yoga/node graphql

Quickstart

You will need to provide schema to Yoga, either by an existing executable schema, or by providing your type definitions and resolver map:

import { createServer } from '@graphql-yoga/node'

const server = createServer({
  schema: {
    typeDefs: /* GraphQL */ `
      type Query {
        hello: String
      }
    `,
    resolvers: {
      Query: {
        hello: () => 'Hello from Yoga!',
      },
    },
  },
})

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, Urql...) 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 over HTTP spec compliant
  • TypeScript
  • File upload with GraphQL Multipart Request spec
  • Realtime capabilities
  • Accepts application/json, application/graphql+json, application/x-www-form-urlencoded, application/graphql and multipart/formdata 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

Downloads/wk

82.7K

GitHub Stars

7.1K

LAST COMMIT

7mos ago

MAINTAINERS

4

CONTRIBUTORS

76

OPEN ISSUES

35

OPEN PRs

15
VersionTagPublished
2.2.3
latest
2mos ago
3.0.0-alpha-20221001132735-022c11d7
alpha
21hrs ago
3.0.0-next.0
three
11d ago
2.2.3-canary-0a78c8b.0
canary
2mos ago
No alternatives found
No tutorials found
Add a tutorial

Rate & Review

100
No reviews found
Be the first to rate