$ npm install graphql-playground-middleware-koa
Koa middleware to expose an endpoint for the GraphQL Playground IDE SECURITY NOTE: All versions of
graphql-playground-koa
until1.6.15
or later have a security vulnerability when unsanitized user input is used while invokingkoaPlayground()
. Read more below
Using yarn:
yarn add graphql-playground-middleware-koa
Or npm:
npm install graphql-playground-middleware-koa --save
See full example in examples/basic.
const koa = require('koa')
const koaRouter = require('koa-router')
const koaPlayground = require('graphql-playground-middleware-koa')
const app = new koa()
const router = new koaRouter()
router.all('/playground', koaPlayground({ endpoint: '/graphql' }))
All versions before 1.6.15
were vulnerable to user-defined input to koaPlayground()
. Read more in the security notes
To fix the issue, you can upgrade to 1.6.15
or later. If you aren't able to upgrade, see the security notes for a workaround.
yarn:
yarn add graphql-playground-koa@^1.6.15
npm:
npm install --save graphql-playground-koa@^1.6.15
© 2010 - cnpmjs.org x YWFE | Home | YWFE