0.1.2 • Published 1 year ago

@honojs/graphql-server v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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

1 year ago

0.1.1

1 year ago

0.1.0

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago