Merge branch 'master' into refactor/strategy-proxy-handling
This commit is contained in:
@@ -667,14 +667,9 @@ export default {
|
|||||||
const gqlQueryString = this.gqlQueryString;
|
const gqlQueryString = this.gqlQueryString;
|
||||||
this.variables.forEach(variable => {
|
this.variables.forEach(variable => {
|
||||||
// todo: better variable type validation
|
// todo: better variable type validation
|
||||||
const intRex = new RegExp(`\$${variable.key}\: Int`);
|
if (gqlQueryString.indexOf(`\$${variable.key}: Int`) > -1) {
|
||||||
intRex.compile();
|
|
||||||
const floatRex = new RegExp(`\$${variable.key}\: Float`);
|
|
||||||
floatRex.compile();
|
|
||||||
|
|
||||||
if (intRex.test(gqlQueryString)) {
|
|
||||||
variables[variable.key] = parseInt(variable.value);
|
variables[variable.key] = parseInt(variable.value);
|
||||||
} else if (floatRex.test(gqlQueryString)) {
|
} else if (gqlQueryString.indexOf(`\$${variable.key}: Float`) > -1) {
|
||||||
variables[variable.key] = parseFloat(variable.value);
|
variables[variable.key] = parseFloat(variable.value);
|
||||||
} else {
|
} else {
|
||||||
variables[variable.key] = variable.value;
|
variables[variable.key] = variable.value;
|
||||||
|
|||||||
Reference in New Issue
Block a user