0.4.3 • Published 3 months ago

@hono/graphql-server v0.4.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

GraphQL Server Middleware

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()

Author

Minghe Huang h.minghe@gmail.com

0.4.3

3 months ago

0.4.2

3 months ago

0.4.1

7 months ago

0.4.0

1 year ago

0.2.0

1 year ago