diff --git a/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.tsx b/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.tsx index 8a34ced4f..413ebaf2b 100644 --- a/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.tsx +++ b/packages/insomnia-app/app/ui/components/editors/body/graph-ql-editor.tsx @@ -18,6 +18,8 @@ import { SetRequired } from 'type-fest'; import { AUTOBIND_CFG, CONTENT_TYPE_JSON, DEBOUNCE_MILLIS } from '../../../../common/constants'; import { database as db } from '../../../../common/database'; +import { hotKeyRefs } from '../../../../common/hotkeys'; +import { executeHotKey } from '../../../../common/hotkeys-listener'; import { markdownToHTML } from '../../../../common/markdown-to-html'; import { jsonParseOr } from '../../../../common/misc'; import { HandleGetRenderContext, HandleRender } from '../../../../common/render'; @@ -36,6 +38,7 @@ import { CodeEditor } from '../../codemirror/code-editor'; import { GraphQLExplorer } from '../../graph-ql-explorer/graph-ql-explorer'; import { ActiveReference } from '../../graph-ql-explorer/graph-ql-types'; import { HelpTooltip } from '../../help-tooltip'; +import { KeydownBinder } from '../../keydown-binder'; import { showModal } from '../../modals'; import { ResponseDebugModal } from '../../modals/response-debug-modal'; import { TimeFromNow } from '../../time-from-now'; @@ -192,6 +195,10 @@ export class GraphQLEditor extends PureComponent { }); } + _handleKeyDown(event: KeyboardEvent) { + executeHotKey(event, hotKeyRefs.BEAUTIFY_REQUEST_BODY, this._handlePrettify); + } + _handleClickReference(reference: Maybe, event: MouseEvent) { event.preventDefault(); @@ -726,6 +733,7 @@ export class GraphQLEditor extends PureComponent { return (
+