Skip to content

Commit

Permalink
fix(fe): add fetch policy to useSuspenseQuery (#2236)
Browse files Browse the repository at this point in the history
fix(fe): add fetch policy
  • Loading branch information
Kohminchae authored Nov 23, 2024
1 parent 7027bab commit 3f41ce0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export function BelongedContestTable({
const { data } = useSuspenseQuery(GET_BELONGED_CONTESTS, {
variables: {
problemId
}
},
// TODO: 필요시 refetch 하도록 수정
fetchPolicy: 'network-only'
})

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ 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 @@ -30,15 +29,7 @@ export function ScoreCautionDialog({
problemId
}: ScoreCautionDialogProps) {
const [updateContestsProblemsScores] = useMutation(
UPDATE_CONTEST_PROBLEMS_SCORES,
{
refetchQueries: [
{
query: GET_BELONGED_CONTESTS,
variables: { problemId }
}
]
}
UPDATE_CONTEST_PROBLEMS_SCORES
)

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

0 comments on commit 3f41ce0

Please sign in to comment.