From 016a18d3b20678a40584a528b4ce29ffd3c08b45 Mon Sep 17 00:00:00 2001 From: James George Date: Thu, 12 Oct 2023 00:45:45 -0700 Subject: [PATCH] fix(common): use tab service within helpers (#3448) --- .../src/helpers/graphql/connection.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/hoppscotch-common/src/helpers/graphql/connection.ts b/packages/hoppscotch-common/src/helpers/graphql/connection.ts index 6f6acb841..8cf1c8b78 100644 --- a/packages/hoppscotch-common/src/helpers/graphql/connection.ts +++ b/packages/hoppscotch-common/src/helpers/graphql/connection.ts @@ -1,5 +1,6 @@ import { GQLHeader, HoppGQLAuth, makeGQLRequest } from "@hoppscotch/data" import { OperationType } from "@urql/core" +import * as E from "fp-ts/Either" import { GraphQLEnumType, GraphQLInputObjectType, @@ -11,11 +12,12 @@ import { printSchema, } from "graphql" import { computed, reactive, ref } from "vue" -import { addGraphqlHistoryEntry, makeGQLHistoryEntry } from "~/newstore/history" -import { currentTabID } from "./tab" import { getService } from "~/modules/dioc" + +import { addGraphqlHistoryEntry, makeGQLHistoryEntry } from "~/newstore/history" + import { InterceptorService } from "~/services/interceptor.service" -import * as E from "fp-ts/Either" +import { GQLTabService } from "~/services/tab/graphql" const GQL_SCHEMA_POLL_INTERVAL = 7000 @@ -61,6 +63,9 @@ type Connection = { schema: GraphQLSchema | null } +const tabs = getService(GQLTabService) +const currentTabID = computed(() => tabs.currentTabID.value) + export const connection = reactive({ state: "DISCONNECTED", subscriptionState: new Map(),