From 7022ef5f7ee0a96fa42ba100c95c360ffa9045aa Mon Sep 17 00:00:00 2001 From: Dmitry Yankowski Date: Sun, 23 Feb 2020 19:42:59 -0500 Subject: [PATCH] Fix variables JSON string I don't have any variables set, and when running a mutation; I get the following error: ``` Error SyntaxError: Unexpected end of JSON input at JSON.parse () at VueComponent._callee$ (graphql.vue?f047:505) at tryCatch (runtime.js?96cf:45) at Generator.invoke [as _invoke] (runtime.js?96cf:271) at Generator.prototype. [as next] (runtime.js?96cf:97) at asyncGeneratorStep (asyncToGenerator.js?1da1:3) at _next (asyncToGenerator.js?1da1:25) at eval (asyncToGenerator.js?1da1:32) at new Promise () at VueComponent.eval (asyncToGenerator.js?1da1:21) ``` Setting the `variablesJSONString` variable to the correct default (`{}`) fixes this issue :) --- store/state.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/state.js b/store/state.js index f70132768..25d04f6fd 100644 --- a/store/state.js +++ b/store/state.js @@ -20,7 +20,7 @@ export default () => ({ gql: { url: "https://rickandmortyapi.com/graphql", headers: [], - variablesJSONString: "", + variablesJSONString: "{}", query: "" }, oauth2: {