This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@honojs/graphql-server
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @honojs/graphql-server

Weekly Downloads

17

Version

0.1.2

License

MIT

Unpacked Size

12.2 kB

Total Files

10

Last publish

Collaborators

  • codehex
  • metrue
  • yusukebe