Skip to content

Commit 94d23ec

Browse files
committed
fix: fix chainid bug in refetch
1 parent 9daf106 commit 94d23ec

23 files changed

+76
-6
lines changed

web-devtools/src/hooks/queries/useDisputeTemplateFromId.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useQuery } from "@tanstack/react-query";
22

33
import { useGraphqlBatcher } from "context/GraphqlBatcher";
4+
import { DEFAULT_CHAIN } from "consts/chains";
45
import { isUndefined } from "utils/isUndefined";
56

67
import { graphql } from "src/graphql-generated";
@@ -29,6 +30,7 @@ export const useDisputeTemplateFromId = (templateId?: string) => {
2930
await graphqlBatcher.fetch({
3031
id: crypto.randomUUID(),
3132
document: disputeTemplateQuery,
33+
chainId: DEFAULT_CHAIN,
3234
variables: { id: templateId?.toString() },
3335
isDisputeTemplate: true,
3436
}),

web/src/components/ErrorFallback.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const ErrorContainer = styled.div`
2828
flex-direction: column;
2929
justify-content: center;
3030
align-items: center;
31+
3132
${landscapeStyle(
3233
() => css`
3334
flex-direction: row;
@@ -42,6 +43,7 @@ const InfoWrapper = styled.div`
4243
gap: 32px;
4344
align-items: center;
4445
flex: 1;
46+
4547
${landscapeStyle(
4648
() => css`
4749
align-items: start;

web/src/hooks/queries/useAllCasesQuery.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useQuery } from "@tanstack/react-query";
22

33
import { useGraphqlBatcher } from "context/GraphqlBatcher";
4+
import { DEFAULT_CHAIN } from "consts/chains";
45

56
import { graphql } from "src/graphql";
67
import { AllCasesQuery } from "src/graphql/graphql";
@@ -21,6 +22,11 @@ export const useAllCasesQuery = () => {
2122
return useQuery({
2223
queryKey: [`allCasesQuery`],
2324
queryFn: async () =>
24-
await graphqlBatcher.fetch({ id: crypto.randomUUID(), document: allCasesQuery, variables: {} }),
25+
await graphqlBatcher.fetch({
26+
id: crypto.randomUUID(),
27+
document: allCasesQuery,
28+
chainId: DEFAULT_CHAIN,
29+
variables: {},
30+
}),
2531
});
2632
};

web/src/hooks/queries/useCasesQuery.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useQuery } from "@tanstack/react-query";
22
import { Address } from "viem";
33

44
import { useGraphqlBatcher } from "context/GraphqlBatcher";
5+
import { DEFAULT_CHAIN } from "consts/chains";
56
import { isUndefined } from "utils/index";
67

78
import { graphql } from "src/graphql";
@@ -77,6 +78,7 @@ export const useCasesQuery = (skip = 0, first = 3, where?: Dispute_Filter, sortO
7778
await graphqlBatcher.fetch({
7879
id: crypto.randomUUID(),
7980
document: isUndefined(where) ? casesQuery : casesQueryWhere,
81+
chainId: DEFAULT_CHAIN,
8082
variables: {
8183
first,
8284
skip,
@@ -98,6 +100,7 @@ export const useMyCasesQuery = (user?: Address, skip = 0, where?: Dispute_Filter
98100
await graphqlBatcher.fetch({
99101
id: crypto.randomUUID(),
100102
document: isUndefined(where) ? myCasesQuery : myCasesQueryWhere,
103+
chainId: DEFAULT_CHAIN,
101104
variables: {
102105
skip,
103106
id: user?.toLowerCase(),

web/src/hooks/queries/useClassicAppealQuery.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useQuery } from "@tanstack/react-query";
22

33
import { REFETCH_INTERVAL } from "consts/index";
44
import { useGraphqlBatcher } from "context/GraphqlBatcher";
5+
import { DEFAULT_CHAIN } from "consts/chains";
56

67
import { graphql } from "src/graphql";
78
import { ClassicAppealQuery } from "src/graphql/graphql";
@@ -49,6 +50,7 @@ export const useClassicAppealQuery = (id?: string | number) => {
4950
? await graphqlBatcher.fetch({
5051
id: crypto.randomUUID(),
5152
document: classicAppealQuery,
53+
chainId: DEFAULT_CHAIN,
5254
variables: {
5355
disputeID: id?.toString(),
5456
orderBy: "timestamp",

web/src/hooks/queries/useCounter.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useQuery } from "@tanstack/react-query";
22

33
import { useGraphqlBatcher } from "context/GraphqlBatcher";
4+
import { DEFAULT_CHAIN } from "consts/chains";
45

56
import { graphql } from "src/graphql";
67
import { CounterQuery } from "src/graphql/graphql";
@@ -28,6 +29,12 @@ export const useCounterQuery = () => {
2829

2930
return useQuery<CounterQuery>({
3031
queryKey: [`useCounterQuery`],
31-
queryFn: async () => await graphqlBatcher.fetch({ id: crypto.randomUUID(), document: counterQuery, variables: {} }),
32+
queryFn: async () =>
33+
await graphqlBatcher.fetch({
34+
id: crypto.randomUUID(),
35+
document: counterQuery,
36+
chainId: DEFAULT_CHAIN,
37+
variables: {},
38+
}),
3239
});
3340
};

web/src/hooks/queries/useCourtDetails.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useQuery } from "@tanstack/react-query";
22

33
import { REFETCH_INTERVAL } from "consts/index";
4+
import { DEFAULT_CHAIN } from "consts/chains";
45
import { useGraphqlBatcher } from "context/GraphqlBatcher";
56

67
import { graphql } from "src/graphql";
@@ -37,6 +38,11 @@ export const useCourtDetails = (id?: string) => {
3738
enabled: isEnabled,
3839
refetchInterval: REFETCH_INTERVAL,
3940
queryFn: async () =>
40-
await graphqlBatcher.fetch({ id: crypto.randomUUID(), document: courtDetailsQuery, variables: { id } }),
41+
await graphqlBatcher.fetch({
42+
id: crypto.randomUUID(),
43+
document: courtDetailsQuery,
44+
chainId: DEFAULT_CHAIN,
45+
variables: { id },
46+
}),
4147
});
4248
};

web/src/hooks/queries/useCourtPolicyURI.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useQuery } from "@tanstack/react-query";
22

33
import { useGraphqlBatcher } from "context/GraphqlBatcher";
4+
import { DEFAULT_CHAIN } from "consts/chains";
45
import { isUndefined } from "utils/index";
56

67
import { graphql } from "src/graphql";
@@ -29,6 +30,7 @@ export const useCourtPolicyURI = (id?: string | number) => {
2930
? await graphqlBatcher.fetch({
3031
id: crypto.randomUUID(),
3132
document: courtPolicyURIQuery,
33+
chainId: DEFAULT_CHAIN,
3234
variables: { courtID: id.toString() },
3335
})
3436
: undefined,

web/src/hooks/queries/useCourtTree.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useQuery } from "@tanstack/react-query";
22

33
import { useGraphqlBatcher } from "context/GraphqlBatcher";
4+
import { DEFAULT_CHAIN } from "consts/chains";
45

56
import { graphql } from "src/graphql";
67
import { CourtTreeQuery } from "src/graphql/graphql";
@@ -40,7 +41,12 @@ export const useCourtTree = () => {
4041
return useQuery<CourtTreeQuery>({
4142
queryKey: ["courtTreeQuery"],
4243
queryFn: async () =>
43-
await graphqlBatcher.fetch({ id: crypto.randomUUID(), document: courtTreeQuery, variables: {} }),
44+
await graphqlBatcher.fetch({
45+
id: crypto.randomUUID(),
46+
document: courtTreeQuery,
47+
chainId: DEFAULT_CHAIN,
48+
variables: {},
49+
}),
4450
});
4551
};
4652

web/src/hooks/queries/useDisputeDetailsQuery.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useQuery } from "@tanstack/react-query";
22

33
import { REFETCH_INTERVAL } from "consts/index";
4+
import { DEFAULT_CHAIN } from "consts/chains";
45
import { useGraphqlBatcher } from "context/GraphqlBatcher";
56

67
import { graphql } from "src/graphql";
@@ -50,6 +51,7 @@ export const useDisputeDetailsQuery = (id?: string | number) => {
5051
await graphqlBatcher.fetch({
5152
id: crypto.randomUUID(),
5253
document: disputeDetailsQuery,
54+
chainId: DEFAULT_CHAIN,
5355
variables: { disputeID: id?.toString() },
5456
}),
5557
});

0 commit comments

Comments
 (0)