diff --git a/components/graphql/queryeditor.vue b/components/graphql/queryeditor.vue new file mode 100644 index 000000000..23eb15a04 --- /dev/null +++ b/components/graphql/queryeditor.vue @@ -0,0 +1,113 @@ + + + diff --git a/functions/utils/debounce.js b/functions/utils/debounce.js new file mode 100644 index 000000000..09acda07d --- /dev/null +++ b/functions/utils/debounce.js @@ -0,0 +1,15 @@ +// Debounce is a higher order function which makes its enclosed function be executed +// only if the function wasn't called again till 'delay' time has passed, this helps reduce impact of heavy working +// functions which might be called frequently +// NOTE : Don't use lambda functions as this doesn't get bound properly in them, use the 'function (args) {}' format +const debounce = (func, delay) => { + let inDebounce + return function() { + const context = this + const args = arguments + clearTimeout(inDebounce) + inDebounce = setTimeout(() => func.apply(context, args), delay) + } +} + +export default debounce; diff --git a/pages/graphql.vue b/pages/graphql.vue index 05e14e940..0aee8d984 100644 --- a/pages/graphql.vue +++ b/pages/graphql.vue @@ -175,7 +175,8 @@ - import("../components/graphql/field"), "gql-type": () => import("../components/graphql/type"), autocomplete: () => import("../components/autocomplete"), - Editor: AceEditor + Editor: AceEditor, + QueryEditor: QueryEditor }, data() { return { @@ -543,6 +546,7 @@ export default { responseBodyMaxLines: 16 }; }, + computed: { url: { get() {