From 84051db4e1391ff2a9872f246548e5a909ef2216 Mon Sep 17 00:00:00 2001 From: hassnian <44554284+hassnian@users.noreply.github.com> Date: Mon, 28 Oct 2024 07:53:01 +0500 Subject: [PATCH] ref(useSubscriptionGraphql.ts): remove `fetchGraphql` util --- composables/useSubscriptionGraphql.ts | 11 ++++++++++- utils/graphql.ts | 14 -------------- 2 files changed, 10 insertions(+), 15 deletions(-) delete mode 100644 utils/graphql.ts diff --git a/composables/useSubscriptionGraphql.ts b/composables/useSubscriptionGraphql.ts index a038ba1a5c..0802ae8fed 100644 --- a/composables/useSubscriptionGraphql.ts +++ b/composables/useSubscriptionGraphql.ts @@ -32,7 +32,16 @@ export default function ({ async function pollData() { try { - const response = await fetchGraphql(query, { client }) + const response = await $fetch(httpUrl, { + method: 'POST', + body: { + query: ` + query { + ${query} + } + `, + }, + }) const newResult = response.data as any diff --git a/utils/graphql.ts b/utils/graphql.ts deleted file mode 100644 index 6f9b51c43b..0000000000 --- a/utils/graphql.ts +++ /dev/null @@ -1,14 +0,0 @@ -export const fetchGraphql = async (query: string, { client }: { client?: string } = {}) => { - const httpUrl = apolloClientConfig[client || usePrefix().client.value]?.httpEndpoint as string - - return $fetch(httpUrl, { - method: 'POST', - body: { - query: ` - query { - ${query} - } - `, - }, - }) -}