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
Refactor graphql page to use Network Strategies
Andrew Bastin3a8b4337f030
diff --git a/pages/graphql.vue b/pages/graphql.vueindex 4f21ba2d8..6e66a96e6 100644--- a/pages/graphql.vue+++ b/pages/graphql.vue@@ -386,6 +386,7 @@ import axios from "axios";import * as gql from "graphql";import textareaAutoHeight from "../directives/textareaAutoHeight";import AceEditor from "../components/ace-editor";+import { sendNetworkRequest } from "../functions/network";export default {directives: {@@ -685,21 +686,7 @@ export default {data: JSON.stringify({ query: gqlQueryString, variables })};- const reqConfig = this.$store.state.postwoman.settings.PROXY_ENABLED- ? {- 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;+ const data = await sendNetworkRequest(reqOptions, this.$store);this.responseString = JSON.stringify(data.data, null, 2);