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)
GraphQL Yoga
Fully-featured GraphQL Server with focus on easy setup, performance & great developer experience
Go to documenation
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
- Fully typed with TypeScript
- GraphQL over HTTP spec compliant
- GraphiQL included
- File uploads with GraphQL Multipart Request spec
- Subscriptions and realtime capabilities
- Automatic persisted queries
- Built-in parsing and validation caching
- Testing utilities
- Supports ESM
- Runs everywhere, including environments like:
- And more...
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
:
- Install Node.js
- Run in your terminal:
npm i -g pnpm@8 && pnpm install && pnpm build
- Add tests to
packages/graphql-yoga/__tests__
using Jest APIs - 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-22 01:36:46 twentyhq/twenty
2024-11-21 16:58:07 labring/FastGPT
2024-11-21 16:14:54 RSSNext/Follow
2024-11-21 14:55:41 continuedev/continue
2024-11-21 00:40:00 immich-app/immich
2024-11-20 23:34:25 lobehub/lobe-chat