MyGit

dotansimha/graphql-yoga

Fork: 571 Star: 8247 (更新于 2024-11-03 22:30:13)

license: MIT

Language: TypeScript .

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

最后发布版本: release-1723761948464 ( 2024-08-16 06:45:48)

官方网址 GitHub网址

GraphQL Yoga

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

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

最近版本更新:(数据更新于 2024-10-12 21:00:28)

2024-08-16 06:45:48 release-1723761948464

2024-08-14 19:37:18 release-1723635438550

2024-08-04 11:40:06 release-1722742806648

2024-07-26 01:30:28 release-1721928628389

2024-07-24 08:52:10 release-1721782329849

2024-07-18 13:58:26 release-1721282306424

2024-07-01 19:02:16 release-1719831736592

2024-06-30 09:54:07 release-1719712447060

2024-06-18 17:31:13 release-1718703073068

2024-05-08 17:18:40 release-1715159920198

主题(topics):

bun, deno, fetch, graphql, graphql-server, javascript, nodejs, the-guild, typescript, w3c, whatwg

dotansimha/graphql-yoga同语言 TypeScript最近更新仓库

2024-11-05 17:55:23 langgenius/dify

2024-11-05 16:59:32 laurent22/joplin

2024-11-05 11:52:31 RSSNext/Follow

2024-11-05 07:18:03 microsoft/genaiscript

2024-11-05 05:06:06 getmaxun/maxun

2024-11-04 14:44:09 x-extends/vxe-table