Skip to content

Commit

Permalink
fix(fe): add fetch policy to useSuspenseQuery (#2229)
Browse files Browse the repository at this point in the history
* fix(fe): add fetch policy

* fix(fe): use refetch

* fix(fe): resolve build failed
  • Loading branch information
Kohminchae authored Nov 22, 2024
1 parent 9e7bebb commit 6071189
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
DialogHeader,
DialogTitle
} from '@/components/shadcn/dialog'
import { GET_BELONGED_CONTESTS } from '@/graphql/contest/queries'
import { UPDATE_CONTEST_PROBLEMS_SCORES } from '@/graphql/problem/mutations'
import { useMutation } from '@apollo/client'
import { Suspense, useState } from 'react'
Expand All @@ -29,7 +30,15 @@ export function ScoreCautionDialog({
problemId
}: ScoreCautionDialogProps) {
const [updateContestsProblemsScores] = useMutation(
UPDATE_CONTEST_PROBLEMS_SCORES
UPDATE_CONTEST_PROBLEMS_SCORES,
{
refetchQueries: [
{
query: GET_BELONGED_CONTESTS,
variables: { problemId }
}
]
}
)

const [zeroSetContests, setZeroSetContests] = useState<number[]>([])
Expand Down

0 comments on commit 6071189

Please sign in to comment.