netlify-onegraph-internal
Advanced tools
Comparing version 0.0.25 to 0.0.26
@@ -260,3 +260,3 @@ "use strict"; | ||
var name = def.variable.name.value; | ||
var withCoercer = coercerFor(def.type, "req.query?." + name); | ||
var withCoercer = coercerFor(def.type, "typeof req.query?." + name + " === 'string' ? req.query?." + name + " : req.query?." + name + "[0]"); | ||
return "const " + (0, codegenHelpers_1.munge)(name) + " = " + withCoercer + ";"; | ||
@@ -287,3 +287,3 @@ }).join("\n ")) || "", | ||
.join(", "); | ||
variableValidation = " if (" + condition + ") {\n return json(\n {\n errors: [\"You must supply parameters for: " + message + "\"],\n },\n { status: 422 }\n );\n }"; | ||
variableValidation = " if (" + condition + ") {\n return res.status(422).json({\n errors: [\"You must supply parameters for: " + message + "\"],\n });\n }"; | ||
} | ||
@@ -353,3 +353,3 @@ return (pluckerStyle === "get" ? pluckers.get : pluckers.post) + "\n\n" + (requiredVariableCount > 0 ? variableValidation : "") + "\n\n const { errors, data } = await NetlifyGraph." + operationFunctionName(namedOperationData) + "({ " + invocationParams.join(", ") + " }, {accessToken: accessToken}); \n\n if (errors) {\n console.error(JSON.stringify(errors, null, 2));\n }\n\n console.log(JSON.stringify(data, null, 2));"; | ||
if (netlifyGraphConfig.moduleType === "commonjs") { | ||
return "exports.default = " + name; | ||
return "exports.default = exports." + name; | ||
} | ||
@@ -356,0 +356,0 @@ return "export default " + name; |
{ | ||
"name": "netlify-onegraph-internal", | ||
"version": "0.0.25", | ||
"version": "0.0.26", | ||
"description": "Internal tools for use by Netlify", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
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
335587