fix(doc): update readme and bump version (#14)

pull/29/head
Minghe 2022-08-01 22:49:02 +08:00 committed by GitHub
parent 1a31ccfe41
commit 20b1c8fe9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View File

@ -4,14 +4,14 @@
This middleware depends on [GraphQL.js](https://www.npmjs.com/package/graphql).
```plain
npm i graphql
```sh
npm i @honojs/graphql-server
```
or
```plain
yarn add graphql
yarn add @honojs/graphql-server
```
## Usage
@ -20,7 +20,7 @@ index.js:
```js
import { Hono } from 'hono'
import { graphqlServer } from 'hono/graphql-server'
import { graphqlServer } from '@hono/graphql-server'
import { buildSchema } from 'graphql'
export const app = new Hono()
@ -31,15 +31,17 @@ type Query {
}
`)
const rootValue = {
const rootResolver = (ctx) => {
return {
hello: () => 'Hello Hono!',
}
}
app.use(
'/graphql',
graphqlServer({
schema,
rootValue,
rootResolver,
})
)

View File

@ -1,6 +1,6 @@
{
"name": "@honojs/graphql-server",
"version": "0.0.3",
"version": "0.0.4",
"repository": "git@github.com:honojs/grahql-server.git",
"author": "Minghe Huang <h.minghe@gmail.com>",
"main": "dist/index.js",