Skip to content

Commit

Permalink
refactor: query naming
Browse files Browse the repository at this point in the history
  • Loading branch information
nhestrompia committed Sep 14, 2023
1 parent 3045e6c commit 6f2228d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions web/src/hooks/queries/useMyCasesCounterQuery.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -19,11 +19,11 @@ const myAppealCases = graphql(`
export const useMyCasesCounterQuery = (user?: Address, where?: Dispute_Filter) => {
const isEnabled = !isUndefined(user);

return useQuery<MyAppealCasesQuery>({
return useQuery<MyCasesCounterQuery>({
queryKey: [`useMyCasesCounterQuery`, user],
enabled: isEnabled,
queryFn: async () =>
await graphqlQueryFnHelper(myAppealCases, {
await graphqlQueryFnHelper(myCasesCounter, {
id: user?.toLowerCase(),
where,
}),
Expand Down

0 comments on commit 6f2228d

Please sign in to comment.