Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@webiny/handler-graphql

Package Overview
Dependencies
Maintainers
1
Versions
434
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webiny/handler-graphql - npm Package Compare versions

Comparing version 5.6.0 to 5.7.0-beta.0

plugins/GraphQLSchemaPlugin.d.ts

43

createGraphQLHandler.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc