Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
💚 Fixed #497
pushrbxc4c2f1cbee75
diff --git a/pages/graphql.vue b/pages/graphql.vueindex 5abbde18e..f057e117e 100644--- a/pages/graphql.vue+++ b/pages/graphql.vue@@ -667,16 +667,12 @@ export default {const gqlQueryString = this.gqlQueryString;this.variables.forEach(variable => {// todo: better variable type validation- const intRex = new RegExp(`\$${variable.key}\: Int`);- intRex.compile();- const floatRex = new RegExp(`\$${variable.key}\: Float`);- floatRex.compile();-- if (intRex.test(gqlQueryString)) {+ if (gqlQueryString.indexOf(`\$${variable.key}: Int`) > -1) {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);} else {+ console.log(variable);variables[variable.key] = variable.value;}});