Skip to content

Commit

Permalink
Merge pull request #57 from supergraphql/feature/mime
Browse files Browse the repository at this point in the history
feat: use body-parser-graphql
  • Loading branch information
schickling authored Jan 2, 2018
2 parents d84485f + d207df9 commit 509a833
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"apollo-link": "^1.0.7",
"apollo-server-express": "^1.3.2",
"apollo-upload-server": "^4.0.0-alpha.1",
"body-parser-graphql": "1.0.0",
"cors": "^2.8.4",
"express": "^4.16.2",
"graphql": "^0.12.0",
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as express from 'express'
import * as bodyParser from 'body-parser-graphql'
import * as cors from 'cors'
import * as fs from 'fs'
import { importSchema } from 'graphql-import'
Expand Down Expand Up @@ -50,7 +51,7 @@ export class GraphQLServer {

this.express.post(
this.options.endpoint,
express.json(),
bodyParser.graphql(),
apolloUploadExpress(this.options.uploads),
)

Expand Down
17 changes: 16 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,13 @@ bluebird@^3.5.1:
version "3.5.1"
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9"

[email protected]:
[email protected]:
version "1.0.0"
resolved "https://registry.yarnpkg.com/body-parser-graphql/-/body-parser-graphql-1.0.0.tgz#997de1792ed222cbc4845d404f4549eb88ec6d37"
dependencies:
body-parser "^1.18.2"

[email protected], body-parser@^1.18.2:
version "1.18.2"
resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.2.tgz#87678a19d84b47d859b83199bd59bce222b10454"
dependencies:
Expand Down Expand Up @@ -549,6 +555,15 @@ graphql-import@^0.1.7:
graphql "^0.12.3"
lodash "^4.17.4"

graphql-import@^0.1.9:
version "0.1.9"
resolved "https://registry.yarnpkg.com/graphql-import/-/graphql-import-0.1.9.tgz#9161f4f7ea92337b60fd40e22e64d3a68c212729"
dependencies:
"@types/graphql" "0.11.7"
"@types/lodash" "^4.14.85"
graphql "^0.12.3"
lodash "^4.17.4"

graphql-playground-html@^1.3.13:
version "1.3.13"
resolved "https://registry.yarnpkg.com/graphql-playground-html/-/graphql-playground-html-1.3.13.tgz#ac1b0491af1052fb0cbb090e054f6f6fa2797486"
Expand Down

0 comments on commit 509a833

Please sign in to comment.