monorepo for Hono third-party middleware/helpers/wrappers
 
 
Go to file
Yusuke Wada c7e949b0f9 v0.1.2 2023-02-04 11:09:54 +09:00
.github/workflows ci: fix ci for Bun 2023-02-04 11:07:53 +09:00
bun_test fix: bump up Hono and make it `peerDependencies` to fix type mismatch (#21) 2022-12-13 16:32:51 +09:00
deno_dist docs(readme): rename to `@hono/graphql-server` 2023-02-04 11:02:22 +09:00
deno_test fix: bump up Hono and make it `peerDependencies` to fix type mismatch (#21) 2022-12-13 16:32:51 +09:00
src fix: bump up Hono and make it `peerDependencies` to fix type mismatch (#21) 2022-12-13 16:32:51 +09:00
.eslintignore feat(lint): enable lint (#11) 2022-07-30 21:36:01 +08:00
.eslintrc.js feat(lint): enable lint (#11) 2022-07-30 21:36:01 +08:00
.gitignore chore: remove and ignore `yarn-error.log` (#3) 2022-07-27 21:25:34 +08:00
.prettierrc feat(lint): enable lint (#11) 2022-07-30 21:36:01 +08:00
README.md docs(readme): rename to `@hono/graphql-server` 2023-02-04 11:02:22 +09:00
jest.config.js init 2022-07-21 08:43:43 +08:00
package.json v0.1.2 2023-02-04 11:09:54 +09:00
tsconfig.build.json chore: don't emit test files not needed (#4) 2022-07-27 21:25:11 +08:00
tsconfig.json init 2022-07-21 08:43:43 +08:00
yarn.lock chore: setup `np` for releasing (#22) 2022-12-13 16:42:39 +09:00

README.md

GraphQL Server Middleware

Information

GraphQL Server Middleware @honojs/graphql-server is renamed to @hono/graphql-server. @honojs/graphql-server is not maintained, please use @hono/graphql-server. Also, for Deno, you can use import with npm: prefix like npm:@hono/graphql-server.

Requirements

This middleware depends on GraphQL.js.

npm i @hono/graphql-server

or

yarn add @hono/graphql-server

Usage

index.js:

import { Hono } from 'hono'
import { graphqlServer } from '@hono/graphql-server'
import { buildSchema } from 'graphql'

export const app = new Hono()

const schema = buildSchema(`
type Query {
  hello: String
}
`)

const rootResolver = (ctx) => {
  return {
    hello: () => 'Hello Hono!',
  }
}

app.use(
  '/graphql',
  graphqlServer({
    schema,
    rootResolver,
  })
)

app.fire()