File tree Expand file tree Collapse file tree 4 files changed +18
-3
lines changed
packages/graphql-playground-middleware/examples Expand file tree Collapse file tree 4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change
1
+ # GraphQL Playground Express.js Example
2
+
3
+ ``` sh
4
+ $ yarn
5
+ $ node index.js
6
+ ```
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ const bodyParser = require('body-parser')
3
3
const { graphqlExpress} = require ( 'apollo-server-express' )
4
4
const { makeExecutableSchema} = require ( 'graphql-tools' )
5
5
const { expressPlayground} = require ( 'graphql-playground-middleware' )
6
- const cors = require ( 'cors' )
7
6
8
7
const schema = makeExecutableSchema ( {
9
8
typeDefs : `
@@ -24,8 +23,6 @@ const PORT = 4000
24
23
25
24
const app = express ( )
26
25
27
- app . use ( cors ( ) )
28
-
29
26
// bodyParser is needed just for POST.
30
27
app . use ( '/graphql' , bodyParser . json ( ) , graphqlExpress ( { schema } ) )
31
28
app . get ( '/playground' , expressPlayground ( { endpoint : '/graphql' } ) ) // if you want GraphiQL enabled
Original file line number Diff line number Diff line change
1
+ # GraphQL Playground Hapi Example
2
+
3
+ ``` sh
4
+ $ yarn
5
+ $ node index.js
6
+ ```
Original file line number Diff line number Diff line change
1
+ # GraphQL Playground Koa.js Example
2
+
3
+ ``` sh
4
+ $ yarn
5
+ $ node index.js
6
+ ```
You can’t perform that action at this time.
0 commit comments