micro-playground

1.0.1 • Public • Published

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'
);

Package Sidebar

Install

npm i micro-playground

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

1.44 kB

Total Files

4

Last publish

Collaborators

  • tungv