zuper-graphql

0.3.0 • Public • Published

zuper-graphql

GraphQL middlewares for Zuper

Usage

import { Server } from 'http'
import { Application, Router } from 'zuper'
import { graphql, graphiql } from 'zuper-graphql'
import json from 'zuper-json-bodyparser'
import schema from './schema.js'
 
const server = new Server()
const app = new Application()
const router = new Router()
 
router.post('/graphql', json, graphql({ schema }))
router.get('/graphiql', graphiql({ endpointURL: '/graphql' }))
 
app.use(router.middleware)
 
server.on('request', app.handleRequest)
server.listen(80, '127.0.0.1', () => {
  console.log('Server running at http://localhost/')
})

Readme

Keywords

Package Sidebar

Install

npm i zuper-graphql

Weekly Downloads

2

Version

0.3.0

License

MIT

Last publish

Collaborators

  • nicolasparada