Added prettify query button for GraphQL queries

This commit is contained in:
Andrew Bastin
2020-03-05 14:58:32 -05:00
parent 30ee570ef7
commit e4abe4efd5

View File

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