fix(doc): update readme and bump version (#14)
parent
1a31ccfe41
commit
20b1c8fe9f
16
README.md
16
README.md
|
@ -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 = {
|
||||
hello: () => 'Hello Hono!',
|
||||
const rootResolver = (ctx) => {
|
||||
return {
|
||||
hello: () => 'Hello Hono!',
|
||||
}
|
||||
}
|
||||
|
||||
app.use(
|
||||
'/graphql',
|
||||
graphqlServer({
|
||||
schema,
|
||||
rootValue,
|
||||
rootResolver,
|
||||
})
|
||||
)
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue