From 94c24408329c949b07e6a3bcd734246d59a8ae84 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Wed, 29 Jan 2020 20:35:54 -0500 Subject: [PATCH] Hooked the new variable editor to the persistent store --- pages/graphql.vue | 9 ++++++++- store/state.js | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pages/graphql.vue b/pages/graphql.vue index ab04eb41b..0dfdae88e 100644 --- a/pages/graphql.vue +++ b/pages/graphql.vue @@ -364,7 +364,6 @@ export default { data() { return { schemaString: "", - variableString: "{}", commonHeaders: [ "WWW-Authenticate", "Authorization", @@ -527,6 +526,14 @@ export default { this.$store.commit("setGQLState", { value, attribute: "query" }); } }, + variableString: { + get() { + return this.$store.state.gql.variablesJSONString; + }, + set(value) { + this.$store.commit("setGQLState", { value, attribute: "variablesJSONString" }); + } + }, headerString() { const result = this.headers .filter(({ key }) => !!key) diff --git a/store/state.js b/store/state.js index e6ab3b51d..7667b1d0a 100644 --- a/store/state.js +++ b/store/state.js @@ -20,7 +20,7 @@ export default () => ({ gql: { url: "https://rickandmortyapi.com/graphql", headers: [], - variables: [], + variablesJSONString: "", query: "" }, oauth2: {