Skip to content

Commit 509a833

Browse files
authored
Merge pull request #57 from supergraphql/feature/mime
feat: use body-parser-graphql
2 parents d84485f + d207df9 commit 509a833

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"apollo-link": "^1.0.7",
3838
"apollo-server-express": "^1.3.2",
3939
"apollo-upload-server": "^4.0.0-alpha.1",
40+
"body-parser-graphql": "1.0.0",
4041
"cors": "^2.8.4",
4142
"express": "^4.16.2",
4243
"graphql": "^0.12.0",

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as express from 'express'
2+
import * as bodyParser from 'body-parser-graphql'
23
import * as cors from 'cors'
34
import * as fs from 'fs'
45
import { importSchema } from 'graphql-import'
@@ -50,7 +51,7 @@ export class GraphQLServer {
5051

5152
this.express.post(
5253
this.options.endpoint,
53-
express.json(),
54+
bodyParser.graphql(),
5455
apolloUploadExpress(this.options.uploads),
5556
)
5657

yarn.lock

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,13 @@ bluebird@^3.5.1:
178178
version "3.5.1"
179179
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9"
180180

181-
body-parser@1.18.2:
181+
body-parser-graphql@1.0.0:
182+
version "1.0.0"
183+
resolved "https://registry.yarnpkg.com/body-parser-graphql/-/body-parser-graphql-1.0.0.tgz#997de1792ed222cbc4845d404f4549eb88ec6d37"
184+
dependencies:
185+
body-parser "^1.18.2"
186+
187+
body-parser@1.18.2, body-parser@^1.18.2:
182188
version "1.18.2"
183189
resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.2.tgz#87678a19d84b47d859b83199bd59bce222b10454"
184190
dependencies:
@@ -549,6 +555,15 @@ graphql-import@^0.1.7:
549555
graphql "^0.12.3"
550556
lodash "^4.17.4"
551557

558+
graphql-import@^0.1.9:
559+
version "0.1.9"
560+
resolved "https://registry.yarnpkg.com/graphql-import/-/graphql-import-0.1.9.tgz#9161f4f7ea92337b60fd40e22e64d3a68c212729"
561+
dependencies:
562+
"@types/graphql" "0.11.7"
563+
"@types/lodash" "^4.14.85"
564+
graphql "^0.12.3"
565+
lodash "^4.17.4"
566+
552567
graphql-playground-html@^1.3.13:
553568
version "1.3.13"
554569
resolved "https://registry.yarnpkg.com/graphql-playground-html/-/graphql-playground-html-1.3.13.tgz#ac1b0491af1052fb0cbb090e054f6f6fa2797486"

0 commit comments

Comments
 (0)