🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

graphql-playground-middleware-hapi

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-playground-middleware-hapi

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

1.6.19
83

Supply Chain Security

100

Vulnerability

83

Quality

83

Maintenance

100

License

Version published
Weekly downloads
3.7K
-11.14%
Maintainers
6
Weekly downloads
 
Created

graphql-playground-middleware-hapi

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

Installation

Using yarn:

yarn add graphql-playground-middleware-hapi

Or npm:

npm install graphql-playground-middleware-hapi --save

Usage

See full example in examples/basic.

minimal example:

const hapiPlayground = require('graphql-playground-middleware-hapi').default

const playground = {
  plugin: hapiPlayground,
  options: {
    path: '/playground',
    endpoint: '/graphql',
  },
}

const app = new Hapi.server({
  port: 3000,
})

app.register(playground)
;(async () => await app.start())()

Security Notes

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

Security Upgrade Steps

To fix the issue, you can upgrade to 1.6.13 or later. If you aren't able to upgrade, see the security notes for a workaround.

yarn: yarn add graphql-playground-middleware-hapi@^1.6.13

npm: npm install --save graphql-playground-middleware-hapi@^1.6.13

FAQs

Package last updated on 20 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts