graphql-yoga

graphql-yoga downloads graphql-yoga version graphql-yoga license

graphql-yoga类似的npm包:

npm下载趋势

3 年
🌟 在 graphql-yoga 的 README.md 中显示实时使用量图表,只需复制下面的代码。
## Usage Trend
[![Usage Trend of graphql-yoga](https://npm-compare.com/img/npm-trend/THREE_YEARS/graphql-yoga.png)](https://npm-compare.com/graphql-yoga#timeRange=THREE_YEARS)

Cumulative GitHub Star Trend

🌟 在 graphql-yoga 的 README.md 中显示 GitHub stars 趋势图表,只需复制下面的代码。
## GitHub Stars Trend
[![GitHub Stars Trend of graphql-yoga](https://npm-compare.com/img/github-trend/graphql-yoga.png)](https://npm-compare.com/graphql-yoga)

统计详情

npm包名称
下载量
Stars
大小
Issues
发布时间
License
graphql-yoga960,6508,494294 kB1285 天前MIT

graphql-yoga的README

GraphQL Yoga

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

npm bundlephobia minified size bundlephobia minified+zipped size bundlephobia treeshaking license

Quick start

Install

pnpm add graphql-yoga graphql

Start

Make a schema, create Yoga and start a Node server:

import { createServer } from 'node:http'
import { createSchema, createYoga } from 'graphql-yoga'

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

const server = createServer(yoga)

server.listen(4000, () => {
  console.info('Server is running on http://localhost:4000/graphql')
})

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

Documentation

Our documentation website will help you get started.

Examples

We've made sure developers can quickly start with GraphQL Yoga by providing a comprehensive set of examples. See all of them in the examples/ folder.

Comparison

Read more about how GraphQL Yoga compares to other servers in the ecosystem here.

Contributing

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

For this project in particular, to get started on stage/2-failing-test:

  1. Install Node.js
  2. Run in your terminal: npm i -g pnpm@8 && pnpm install && pnpm build
  3. Add tests to packages/graphql-yoga/__tests__ using Jest APIs
  4. Run the tests with pnpm test

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 Code of Conduct as adopted from Contributor Covenant.

License

MIT