Community

안녕하세요! 저도 mutate를 통해서 수정을 했을때, 변경된 데이터로 동기화가 되지않아서 며칠동안 해결 못했던 경험이 있는데 같은 방법으로 해결이 되실수 있을까 하고 답변 남깁니다! queryC

안녕하세요! 저도 mutate를 통해서 수정을 했을때, 변경된 데이터로 동기화가 되지않아서 며칠동안 해결 못했던 경험이 있는데 같은 방법으로 해결이 되실수 있을까 하고 답변 남깁니다! queryClient.invalidateQueries에 refetchType이라는 옵션을 사용해서 refetchType: 'all', 옵션을 추가하는 방식으로 사용해보시겠어요?? 옵션으로는 4가지 선택지가 있네요! 상황에 맞춰서 적용해보시면 될것 같아요. 혹시 몰라 공식문서 링크와 해당설명부 첨부하겠습니다! https://tanstack.com/query/v4/docs/react/reference/QueryClient#queryclientinvalidatequeries refetchType?: 'active' | 'inactive' | 'all' | 'none' Defaults to 'active' When set to active, only queries that match the refetch predicate and are actively being rendered via useQuery and friends will be refetched in the background. When set to inactive, only queries that match the refetch predicate and are NOT actively being rendered via useQuery and friends will be refetched in the background. When set to all, all queries that match the refetch predicate will be refetched in the background. When set to none, no queries will be refetched, and those that match the refetch predicate will be marked as invalid only.

알림

알림이 없습니다