graphile-build-pg
Advanced tools
Comparing version 0.1.0-alpha.21 to 0.1.0-alpha.22
@@ -121,9 +121,9 @@ "use strict"; | ||
var sliceAmount = computed ? 1 : 0; | ||
var argNames = proc.argTypeIds.map(function (_, idx) { | ||
return proc.argNames[idx] || ""; | ||
}).slice(sliceAmount); | ||
var argNames = proc.argTypeIds.slice(sliceAmount).map(function (_, idx) { | ||
return proc.argNames[idx + sliceAmount] || ""; | ||
}); | ||
var argTypes = proc.argTypeIds.slice(sliceAmount).map(function (typeId) { | ||
return introspectionResultsByKind.typeById[typeId]; | ||
}); | ||
var requiredArgCount = Math.max(0, proc.isStrict ? argNames.length - sliceAmount : argNames.length - sliceAmount - proc.argDefaultsNum); | ||
var requiredArgCount = Math.max(0, argNames.length - proc.argDefaultsNum); | ||
var notNullArgCount = proc.isStrict || strictFunctions ? requiredArgCount : 0; | ||
@@ -224,2 +224,4 @@ var argGqlTypes = argTypes.map(function (type, idx) { | ||
}); | ||
// Removes null arguments from end of args list if those arguments have | ||
// defaults in SQL. | ||
while (sqlArgValues.length > requiredArgCount && args[argNames[sqlArgValues.length - 1]] == null) { | ||
@@ -226,0 +228,0 @@ sqlArgValues.pop(); |
@@ -103,5 +103,5 @@ "use strict"; | ||
const sliceAmount = computed ? 1 : 0; | ||
const argNames = proc.argTypeIds.map((_, idx) => proc.argNames[idx] || "").slice(sliceAmount); | ||
const argNames = proc.argTypeIds.slice(sliceAmount).map((_, idx) => proc.argNames[idx + sliceAmount] || ""); | ||
const argTypes = proc.argTypeIds.slice(sliceAmount).map(typeId => introspectionResultsByKind.typeById[typeId]); | ||
const requiredArgCount = Math.max(0, proc.isStrict ? argNames.length - sliceAmount : argNames.length - sliceAmount - proc.argDefaultsNum); | ||
const requiredArgCount = Math.max(0, argNames.length - proc.argDefaultsNum); | ||
const notNullArgCount = proc.isStrict || strictFunctions ? requiredArgCount : 0; | ||
@@ -196,2 +196,4 @@ const argGqlTypes = argTypes.map((type, idx) => { | ||
}); | ||
// Removes null arguments from end of args list if those arguments have | ||
// defaults in SQL. | ||
while (sqlArgValues.length > requiredArgCount && args[argNames[sqlArgValues.length - 1]] == null) { | ||
@@ -198,0 +200,0 @@ sqlArgValues.pop(); |
{ | ||
"name": "graphile-build-pg", | ||
"version": "0.1.0-alpha.21", | ||
"version": "0.1.0-alpha.22", | ||
"description": "Build a GraphQL schema by reflection over a PostgreSQL schema. Easy to customize since it's built with plugins on graphile-build", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
1322089
9086