Skip to content

Commit

Permalink
fix(common): use tab service within helpers (hoppscotch#3448)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 authored Oct 12, 2023
1 parent ba31cda commit 016a18d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/hoppscotch-common/src/helpers/graphql/connection.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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

Expand Down Expand Up @@ -61,6 +63,9 @@ type Connection = {
schema: GraphQLSchema | null
}

const tabs = getService(GQLTabService)
const currentTabID = computed(() => tabs.currentTabID.value)

export const connection = reactive<Connection>({
state: "DISCONNECTED",
subscriptionState: new Map<string, SubscriptionState>(),
Expand Down

0 comments on commit 016a18d

Please sign in to comment.