GraphQL endpoint field is now persisted (#319)

GraphQL endpoint field is now persisted
This commit is contained in:
Liyas Thomas 2019-11-21 10:49:04 +05:30 committed by GitHub
commit 5d011b09ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 1 deletions

View file

@ -136,7 +136,6 @@ export default {
},
data() {
return {
url: "https://rickandmortyapi.com/graphql",
schemaString: "",
queryFields: [],
mutationFields: [],
@ -144,6 +143,16 @@ export default {
gqlTypes: []
};
},
computed: {
url: {
get() {
return this.$store.state.gql.url;
},
set(value) {
this.$store.commit("setGQLState", { value, attribute: "url" });
}
}
},
methods: {
copySchema() {
const aux = document.createElement("textarea");

View file

@ -3,6 +3,10 @@ export default {
state.request[object.attribute] = object.value
},
setGQLState(state, object) {
state.gql[object.attribute] = object.value;
},
addHeaders(state, value) {
state.request.headers.push(value);
},

View file

@ -16,5 +16,8 @@ export default () => ({
rawInput: false,
requestType: '',
contentType: '',
},
gql: {
url: 'https://rickandmortyapi.com/graphql'
}
});