Refactor graphql page to use Network Strategies
This commit is contained in:
@@ -386,6 +386,7 @@ import axios from "axios";
|
|||||||
import * as gql from "graphql";
|
import * as gql from "graphql";
|
||||||
import textareaAutoHeight from "../directives/textareaAutoHeight";
|
import textareaAutoHeight from "../directives/textareaAutoHeight";
|
||||||
import AceEditor from "../components/ace-editor";
|
import AceEditor from "../components/ace-editor";
|
||||||
|
import { sendNetworkRequest } from "../functions/network";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
directives: {
|
directives: {
|
||||||
@@ -685,21 +686,7 @@ export default {
|
|||||||
data: JSON.stringify({ query: gqlQueryString, variables })
|
data: JSON.stringify({ query: gqlQueryString, variables })
|
||||||
};
|
};
|
||||||
|
|
||||||
const reqConfig = this.$store.state.postwoman.settings.PROXY_ENABLED
|
const data = await sendNetworkRequest(reqOptions, this.$store);
|
||||||
? {
|
|
||||||
method: "post",
|
|
||||||
url:
|
|
||||||
this.$store.state.postwoman.settings.PROXY_URL ||
|
|
||||||
`https://postwoman.apollotv.xyz/`,
|
|
||||||
data: reqOptions
|
|
||||||
}
|
|
||||||
: reqOptions;
|
|
||||||
|
|
||||||
const res = await axios(reqConfig);
|
|
||||||
|
|
||||||
const data = this.$store.state.postwoman.settings.PROXY_ENABLED
|
|
||||||
? res.data
|
|
||||||
: res;
|
|
||||||
|
|
||||||
this.responseString = JSON.stringify(data.data, null, 2);
|
this.responseString = JSON.stringify(data.data, null, 2);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user