From 6f2228d88254c4fb5bce63352f0d72b149209c40 Mon Sep 17 00:00:00 2001 From: nhestrompia Date: Thu, 14 Sep 2023 06:49:24 +0300 Subject: [PATCH] refactor: query naming --- web/src/hooks/queries/useMyCasesCounterQuery.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web/src/hooks/queries/useMyCasesCounterQuery.ts b/web/src/hooks/queries/useMyCasesCounterQuery.ts index 74b069149..df891cf60 100644 --- a/web/src/hooks/queries/useMyCasesCounterQuery.ts +++ b/web/src/hooks/queries/useMyCasesCounterQuery.ts @@ -1,13 +1,13 @@ import { graphql } from "src/graphql"; import { Address } from "viem"; import { useQuery } from "@tanstack/react-query"; -import { MyAppealCasesQuery, Dispute_Filter } from "src/graphql/graphql"; +import { MyCasesCounterQuery, Dispute_Filter } from "src/graphql/graphql"; import { graphqlQueryFnHelper } from "utils/graphqlQueryFnHelper"; import { isUndefined } from "utils/index"; -export type { MyAppealCasesQuery }; +export type { MyCasesCounterQuery }; -const myAppealCases = graphql(` - query MyAppealCases($id: ID!, $where: Dispute_filter) { +const myCasesCounter = graphql(` + query MyCasesCounter($id: ID!, $where: Dispute_filter) { user(id: $id) { disputes(orderBy: lastPeriodChange, where: $where) { id @@ -19,11 +19,11 @@ const myAppealCases = graphql(` export const useMyCasesCounterQuery = (user?: Address, where?: Dispute_Filter) => { const isEnabled = !isUndefined(user); - return useQuery({ + return useQuery({ queryKey: [`useMyCasesCounterQuery`, user], enabled: isEnabled, queryFn: async () => - await graphqlQueryFnHelper(myAppealCases, { + await graphqlQueryFnHelper(myCasesCounter, { id: user?.toLowerCase(), where, }),