Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

Added prettify query button for GraphQL queries

Andrew Bastine4abe4efd558
diff --git a/pages/graphql.vue b/pages/graphql.vue
index cce5689ae..1a2f52508 100644
--- a/pages/graphql.vue
+++ b/pages/graphql.vue
@@ -178,6 +178,13 @@
>
<i class="material-icons">file_copy</i>
</button>
+ <button
+ class="icon"
+ @click="doPrettifyQuery"
+ v-tooltip="`${$t('prettify_query')} (${getSpecialKey()}-P)`"
+ >
+ <i class="material-icons">photo_filter</i>
+ </button>
</div>
</div>
<QueryEditor
@@ -452,6 +459,9 @@ export default {
},
methods: {
getSpecialKey: getPlatformSpecialKey,
+ doPrettifyQuery() {
+ this.$refs.queryEditor.prettifyQuery()
+ },
handleJumpToType(type) {
const typesTab = document.getElementById("gqltypes-tab")
typesTab.checked = true