@webiny/handler-graphql
Advanced tools
Comparing version 5.6.0 to 5.7.0-beta.0
@@ -10,4 +10,2 @@ "use strict"; | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _boolean = require("boolean"); | ||
@@ -21,6 +19,2 @@ | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } | ||
const DEFAULT_HEADERS = { | ||
@@ -64,32 +58,9 @@ "Content-Type": "application/json", | ||
try { | ||
const body = JSON.parse(http.request.body); | ||
const result = await (0, _processRequestBody.default)(body, schema, context); | ||
return http.response({ | ||
body: JSON.stringify(result), | ||
statusCode: 200, | ||
headers: DEFAULT_HEADERS | ||
}); | ||
} catch (e) { | ||
const report = { | ||
error: { | ||
name: e.constructor.name, | ||
message: e.message, | ||
stack: e.stack | ||
} | ||
}; | ||
console.log("[@webiny/handler-graphql] An error occurred:", JSON.stringify(report, null, 2)); | ||
if (debug) { | ||
return context.http.response({ | ||
statusCode: 500, | ||
body: JSON.stringify(report, null, 2), | ||
headers: _objectSpread(_objectSpread({}, DEFAULT_HEADERS), {}, { | ||
"Cache-Control": "no-store" | ||
}) | ||
}); | ||
} | ||
throw e; | ||
} | ||
const body = JSON.parse(http.request.body); | ||
const result = await (0, _processRequestBody.default)(body, schema, context); | ||
return http.response({ | ||
body: JSON.stringify(result), | ||
statusCode: 200, | ||
headers: DEFAULT_HEADERS | ||
}); | ||
} | ||
@@ -96,0 +67,0 @@ |
{ | ||
"name": "@webiny/handler-graphql", | ||
"version": "5.6.0", | ||
"version": "5.7.0-beta.0", | ||
"main": "index.js", | ||
@@ -19,7 +19,7 @@ "license": "MIT", | ||
"@graphql-tools/schema": "7.1.5", | ||
"@webiny/error": "5.6.0", | ||
"@webiny/handler": "5.6.0", | ||
"@webiny/handler-http": "5.6.0", | ||
"@webiny/plugins": "5.6.0", | ||
"boolean": "3.0.3", | ||
"@webiny/error": "5.7.0-beta.0", | ||
"@webiny/handler": "5.7.0-beta.0", | ||
"@webiny/handler-http": "5.7.0-beta.0", | ||
"@webiny/plugins": "5.7.0-beta.0", | ||
"boolean": "3.0.4", | ||
"graphql": "14.7.0", | ||
@@ -33,5 +33,5 @@ "graphql-scalars": "1.9.3", | ||
"@babel/preset-env": "^7.5.5", | ||
"@webiny/cli": "^5.6.0", | ||
"@webiny/handler-args": "^5.6.0", | ||
"@webiny/project-utils": "^5.6.0", | ||
"@webiny/cli": "^5.7.0-beta.0", | ||
"@webiny/handler-args": "^5.7.0-beta.0", | ||
"@webiny/project-utils": "^5.7.0-beta.0", | ||
"jest": "^26.6.3", | ||
@@ -50,3 +50,3 @@ "jest-mock-console": "^1.0.0", | ||
}, | ||
"gitHead": "99f465b91a61f78034a9935a44738e1e542313c5" | ||
"gitHead": "f60e4fc0bd233ff1328b5e5d6cfc9abf894a9369" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63
899
72242
2
+ Added@webiny/error@5.7.0-beta.0(transitive)
+ Added@webiny/handler@5.7.0-beta.0(transitive)
+ Added@webiny/handler-http@5.7.0-beta.0(transitive)
+ Added@webiny/plugins@5.7.0-beta.0(transitive)
+ Addedboolean@3.0.4(transitive)
- Removed@webiny/error@5.6.0(transitive)
- Removed@webiny/handler@5.6.0(transitive)
- Removed@webiny/handler-http@5.6.0(transitive)
- Removed@webiny/plugins@5.6.0(transitive)
- Removedboolean@3.0.3(transitive)
Updated@webiny/error@5.7.0-beta.0
Updated@webiny/handler@5.7.0-beta.0
Updated@webiny/plugins@5.7.0-beta.0
Updatedboolean@3.0.4