diff --git a/.mise/config.toml b/.mise/config.toml index 8147ce5..322620f 100644 --- a/.mise/config.toml +++ b/.mise/config.toml @@ -1,3 +1,13 @@ [tools] node = "22" pnpm = "9" + +[tasks.validate] +description = "Run all validation checks (install, typecheck, lint, test, knip)" +run = """ +pnpm install --frozen-lockfile +pnpm typecheck +pnpm lint +pnpm test +pnpm knip +""" diff --git a/packages/frontend/src/views/GraphQLViewMode.vue b/packages/frontend/src/views/GraphQLViewMode.vue index 67f21a4..d3c4560 100644 --- a/packages/frontend/src/views/GraphQLViewMode.vue +++ b/packages/frontend/src/views/GraphQLViewMode.vue @@ -79,6 +79,11 @@ const parseHttpRaw = (raw: string) => { return { method, headers, body }; }; +const isResponseContent = (raw: string | undefined): boolean => { + if (raw === undefined || raw === "") return true; + return raw.trimStart().startsWith("HTTP/"); +}; + const getRawData = computed((): string => { if (isReplayTab.value) { const editor = props.sdk.window?.getActiveEditor?.(); @@ -86,7 +91,16 @@ const getRawData = computed((): string => { const editorView = editor.getEditorView(); if (editorView !== undefined && editorView !== null) { const raw = editorView.state.doc.toString(); - if (raw !== undefined && raw !== null && raw !== "") return raw; + if (!isResponseContent(raw)) { + return raw; + } + } + } + + if (cachedEditorView.value !== undefined) { + const raw = cachedEditorView.value.state.doc.toString(); + if (!isResponseContent(raw)) { + return raw; } } }