Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

graphql-playground-middleware-koa

graphcool181.5kMIT1.6.22TypeScript support: included

GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration).

graphql, graphiql, playground, graphcool, koa

readme

graphql-playground-middleware-koa

Koa middleware to expose an endpoint for the GraphQL Playground IDE SECURITY NOTE: All versions of graphql-playground-koa until 1.6.15 or later have a security vulnerability when unsanitized user input is used while invoking koaPlayground(). Read more below

Installation

Using yarn:

yarn add graphql-playground-middleware-koa

Or npm:

npm install graphql-playground-middleware-koa --save

Usage

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

Security Notes

All versions before 1.6.15 were vulnerable to user-defined input to koaPlayground(). Read more in the security notes

Security Upgrade Steps

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

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.6.22 (2021-11-04)

Note: Version bump only for package graphql-playground-middleware-koa

1.6.21 (2020-10-20)

Note: Version bump only for package graphql-playground-middleware-koa

1.6.20 (2020-09-15)

Note: Version bump only for package graphql-playground-middleware-koa

1.6.19 (2020-08-30)

Note: Version bump only for package graphql-playground-middleware-koa

1.6.18 (2020-08-30)

Bug Fixes

1.6.16 (2020-06-07)

Bug Fixes

1.8.10 (2019-02-23)

1.8.9 (2019-02-01)

1.8.7 (2019-01-28)

1.6.2 (2018-07-06)

1.6.1 (2018-06-26)

1.5.9 (2018-05-25)

Bug Fixes

  • deps: update dependency graphql-playground-html to v1.5.2 (29a6065)

1.3.6 (2017-12-04)

1.3.5 (2017-12-04)

1.3.0 (2017-12-01)

1.2.0 (2017-11-24)

Features

  • extract koa middleware into its own package (8f3a1a8)