diff --git a/packages/hoppscotch-common/src/components.d.ts b/packages/hoppscotch-common/src/components.d.ts index 18a1a24ce..89d47a60b 100644 --- a/packages/hoppscotch-common/src/components.d.ts +++ b/packages/hoppscotch-common/src/components.d.ts @@ -5,7 +5,7 @@ // Read more: https://github.com/vuejs/core/pull/3399 export {} -declare module "vue" { +declare module 'vue' { export interface GlobalComponents { AppActionHandler: typeof import('./components/app/ActionHandler.vue')['default'] AppAnnouncement: typeof import('./components/app/Announcement.vue')['default'] @@ -93,11 +93,13 @@ declare module "vue" { HoppButtonPrimary: typeof import('@hoppscotch/ui')['HoppButtonPrimary'] HoppButtonSecondary: typeof import('@hoppscotch/ui')['HoppButtonSecondary'] HoppSmartAnchor: typeof import('@hoppscotch/ui')['HoppSmartAnchor'] + HoppSmartAutoComplete: typeof import('@hoppscotch/ui')['HoppSmartAutoComplete'] HoppSmartCheckbox: typeof import('@hoppscotch/ui')['HoppSmartCheckbox'] HoppSmartConfirmModal: typeof import('@hoppscotch/ui')['HoppSmartConfirmModal'] HoppSmartExpand: typeof import('@hoppscotch/ui')['HoppSmartExpand'] HoppSmartFileChip: typeof import('@hoppscotch/ui')['HoppSmartFileChip'] HoppSmartInput: typeof import('@hoppscotch/ui')['HoppSmartInput'] + HoppSmartIntersection: typeof import('@hoppscotch/ui')['HoppSmartIntersection'] HoppSmartItem: typeof import('@hoppscotch/ui')['HoppSmartItem'] HoppSmartLink: typeof import('@hoppscotch/ui')['HoppSmartLink'] HoppSmartModal: typeof import('@hoppscotch/ui')['HoppSmartModal'] @@ -145,6 +147,7 @@ declare module "vue" { IconLucideAlertTriangle: typeof import('~icons/lucide/alert-triangle')['default'] IconLucideArrowLeft: typeof import('~icons/lucide/arrow-left')['default'] IconLucideArrowUpRight: typeof import('~icons/lucide/arrow-up-right')['default'] + IconLucideBrush: typeof import('~icons/lucide/brush')['default'] IconLucideCheckCircle: typeof import('~icons/lucide/check-circle')['default'] IconLucideChevronRight: typeof import('~icons/lucide/chevron-right')['default'] IconLucideGlobe: typeof import('~icons/lucide/globe')['default'] @@ -154,6 +157,7 @@ declare module "vue" { IconLucideLayers: typeof import('~icons/lucide/layers')['default'] IconLucideListEnd: typeof import('~icons/lucide/list-end')['default'] IconLucideMinus: typeof import('~icons/lucide/minus')['default'] + IconLucideRss: typeof import('~icons/lucide/rss')['default'] IconLucideSearch: typeof import('~icons/lucide/search')['default'] IconLucideUsers: typeof import('~icons/lucide/users')['default'] InterceptorsErrorPlaceholder: typeof import('./components/interceptors/ErrorPlaceholder.vue')['default'] @@ -202,6 +206,7 @@ declare module "vue" { SmartSlideOver: typeof import('./../../hoppscotch-ui/src/components/smart/SlideOver.vue')['default'] SmartSpinner: typeof import('./../../hoppscotch-ui/src/components/smart/Spinner.vue')['default'] SmartTab: typeof import('./../../hoppscotch-ui/src/components/smart/Tab.vue')['default'] + SmartTable: typeof import('./../../hoppscotch-ui/src/components/smart/Table.vue')['default'] SmartTabs: typeof import('./../../hoppscotch-ui/src/components/smart/Tabs.vue')['default'] SmartToggle: typeof import('./../../hoppscotch-ui/src/components/smart/Toggle.vue')['default'] SmartTree: typeof import('./../../hoppscotch-ui/src/components/smart/Tree.vue')['default'] diff --git a/packages/hoppscotch-common/src/components/graphql/RequestOptions.vue b/packages/hoppscotch-common/src/components/graphql/RequestOptions.vue index 186a632ce..ec2f3c6f2 100644 --- a/packages/hoppscotch-common/src/components/graphql/RequestOptions.vue +++ b/packages/hoppscotch-common/src/components/graphql/RequestOptions.vue @@ -63,6 +63,7 @@ import { GQLResponseEvent, runGQLOperation, gqlMessageEvent, + connection, } from "~/helpers/graphql/connection" import { useService } from "dioc/vue" import { InterceptorService } from "~/services/interceptor.service" @@ -152,13 +153,7 @@ const runQuery = async ( toast.success(t("authorization.graphql_headers")) } } catch (e: any) { - console.log(e) - // response.value = [`${e}`] completePageProgress() - toast.error( - `${t("error.something_went_wrong")}. ${t("error.check_console_details")}`, - {} - ) console.error(e) } platform.analytics?.logEvent({ @@ -177,7 +172,10 @@ watch( } try { - if (event?.operationType !== "subscription") { + if ( + event?.type === "response" && + event?.operationType !== "subscription" + ) { // response.value = [event] emit("update:response", [event]) } else { @@ -192,6 +190,26 @@ watch( { deep: true } ) +watch( + () => connection, + (newVal) => { + if (newVal.error && newVal.state === "DISCONNECTED") { + const response = [ + { + type: "error", + error: { + message: newVal.error.message(t), + type: newVal.error.type, + component: newVal.error.component, + }, + }, + ] + emit("update:response", response) + } + }, + { deep: true } +) + const hideRequestModal = () => { showSaveRequestModal.value = false } diff --git a/packages/hoppscotch-common/src/components/graphql/Response.vue b/packages/hoppscotch-common/src/components/graphql/Response.vue index 17014188a..d830fd0b7 100644 --- a/packages/hoppscotch-common/src/components/graphql/Response.vue +++ b/packages/hoppscotch-common/src/components/graphql/Response.vue @@ -1,6 +1,11 @@