UNPKG

683 BMarkdownView Raw
1# graphql-playground-middleware-express
2
3> Express middleware to expose an endpoint for the GraphQL Playground IDE
4
5## Installation
6
7Using yarn:
8
9```console
10yarn add graphql-playground-middleware-express
11```
12
13Or npm:
14
15```console
16npm install graphql-playground-middleware-express --save
17```
18
19## Usage
20
21See full example in [examples/basic](https://github.com/prisma/graphql-playground/tree/master/packages/graphql-playground-middleware-express/examples/basic).
22
23```js
24const express = require('express')
25const expressPlayground = require('graphql-playground-middleware-express')
26 .default
27
28const app = express()
29
30app.get('/playground', expressPlayground({ endpoint: '/graphql' }))
31```