Skip to content

Commit 29c6cc4

Browse files
authored
Update readme and cover photo for v3 (#1767)
* essentials * no number cover * docs link to v3 * createYoga and use createSchema
1 parent 1da617e commit 29c6cc4

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,24 @@
44

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

7-
[Docs](https://www.graphql-yoga.com/docs)
7+
[Docs](https://www.the-guild.dev/graphql/yoga-server/v3)
88

99
### Installation
1010

1111
```shell
12-
npm i @graphql-yoga/node graphql
12+
yarn add graphql-yoga graphql
1313
```
1414

1515
### Quickstart
1616

17-
You will need to provide schema to Yoga, either by an existing executable schema, or by providing your type definitions and resolver map:
17+
Make a schema, create Yoga and start a Node server with it:
1818

1919
```ts
20-
import { createServer } from '@graphql-yoga/node'
20+
import { createSchema, createYoga } from 'graphql-yoga'
21+
import { createServer } from 'http'
2122

22-
const server = createServer({
23-
schema: {
23+
const yoga = createYoga({
24+
schema: createSchema({
2425
typeDefs: /* GraphQL */ `
2526
type Query {
2627
hello: String
@@ -31,10 +32,12 @@ const server = createServer({
3132
hello: () => 'Hello from Yoga!',
3233
},
3334
},
34-
},
35+
}),
3536
})
3637

37-
server.start()
38+
const server = createServer(yoga)
39+
40+
server.listen(4000)
3841
```
3942

4043
## Overview
@@ -51,7 +54,7 @@ server.start()
5154
- TypeScript
5255
- File upload with [GraphQL Multipart Request spec](https://github.com/jaydenseric/graphql-multipart-request-spec)
5356
- Realtime capabilities
54-
- Accepts `application/json`, `application/graphql+json`, `application/x-www-form-urlencoded`, `application/graphql` and `multipart/formdata` content-types
57+
- Accepts `application/json`, `application/graphql-response+json`, `application/graphql+json`, `application/x-www-form-urlencoded`, `application/graphql` and `multipart/formdata` content-types
5558
- Supports [ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules)
5659
- Runs everywhere: Can be deployed via `now`, `up`, AWS Lambda, Heroku etc.
5760

website/public/cover.png

4.96 KB
Loading

0 commit comments

Comments
 (0)