Skip to content

Commit

Permalink
chore(package): update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Andras Toth committed Jan 18, 2016
1 parent c452618 commit 284d9e8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"no-shadow": 0,
"no-param-reassign": 0,
"id-length": [2, {"exceptions": ["_", "i"]}],
"comma-dangle": [1, "never"]
"comma-dangle": [1, "never"],
"max-len": [2, 120, 2]
}
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@
},
"devDependencies": {
"babel": "^6.3.26",
"babel-cli": "^6.3.17",
"babel-cli": "^6.4.0",
"babel-eslint": "^5.0.0-beta6",
"babel-polyfill": "^6.3.14",
"babel-preset-es2015": "^6.3.13",
"babel-preset-stage-0": "^6.3.13",
"babel-register": "^6.3.13",
"babel-register": "^6.4.3",
"chai": "^3.4.1",
"chai-subset": "^1.2.0",
"eslint": "1.10.3",
"eslint-config-airbnb": "^2.1.1",
"eslint-config-airbnb": "^3.1.0",
"express": "^4.13.3",
"graphql": "^0.4.14",
"hapi": "^11.1.4",
"hapi": "^12.1.0",
"koa": "^2.0.0-alpha.2",
"mocha": "^2.3.4",
"pre-commit": "^1.1.2",
Expand Down
6 changes: 5 additions & 1 deletion src/express/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ function sendError(response, boom) {
export default function middleware({ graphiql = true, schema = required() } = {}) {
return (request, response, next) => {
if (isPath(request) && (isPost(request) || isGet(request))) {
return json(request).then((body) => {
let promise = Promise.resolve(request.body);
if (!(request.body instanceof Object)) {
promise = json(request);
}
return promise.then((body) => {
const { query, variables } = Object.assign({}, body, request.query);

if (isGet(request) && request.accepts('html') && graphiql) {
Expand Down

0 comments on commit 284d9e8

Please sign in to comment.