1.0.1 • Published 6 years ago

micro-playground v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

micro-playground

a wrapper for graphql-playground-html in micro apps

usage

const playground = require('micro-playground');
const { get, post, router } = require('microrouter');
const { microGraphql } = require('apollo-server-micro');

const schema = require('./my-schema.js');

const service = router(
  get('/graphql', playground({ endpointURL: '/graphql' })),
  post('/graphql', microGraphql({ schema })),
  () => 'not found'
);