From 6071189d067adbec3ccdf347fe9ff26975218d31 Mon Sep 17 00:00:00 2001 From: Kohminchae <72334086+Kohminchae@users.noreply.github.com> Date: Fri, 22 Nov 2024 20:47:08 +0900 Subject: [PATCH] fix(fe): add fetch policy to useSuspenseQuery (#2229) * fix(fe): add fetch policy * fix(fe): use refetch * fix(fe): resolve build failed --- .../edit/_components/ScoreCautionDialog.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/frontend/app/admin/problem/[problemId]/edit/_components/ScoreCautionDialog.tsx b/apps/frontend/app/admin/problem/[problemId]/edit/_components/ScoreCautionDialog.tsx index 85a883ff8..9550598ae 100644 --- a/apps/frontend/app/admin/problem/[problemId]/edit/_components/ScoreCautionDialog.tsx +++ b/apps/frontend/app/admin/problem/[problemId]/edit/_components/ScoreCautionDialog.tsx @@ -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' @@ -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([])