const {isLoading, data} = useQuery("allMovies", fetchMovies);useQuery("쿼리key", fetcher함수) 는 fetcher를 가져오고 fetcher 가 로딩중에는 isLoading가 true (data는 undef
query 와 달리 mutation 은 데이터를 create/update/delete 하거나 서버사이드에서 작용시킬때 사용되는게 일반적이다.위의 예제에서 mutate 함수를 호출 할 때 single variable or object를 전달하는 것을 알수 있다. 단순히
이미 가지고 있는 데이터 세트에다가 추가적으로 데이터를 로드 해야될 경우 사용한다. (ex: 무한스크롤 or 페이지네이션 )useInfiniteQuery 를 사용할 때 알아야 하는 사실들data 는 현재 infinite query data를 포함하는 객체이다.data.
QueryClient 는 캐시와 상호작용 할 때 사용한다queryCache?: QueryCacheOptionalThe query cache this client is connected to.mutationCache?: MutationCacheOptionalThe mut
persistQueryClient 플러그인\[persistQueryClient]persistQueryClient는 나중에 사용할 수 있도록 쿼리 클라이언트를 저장하는 perister와 상호 작용하기 위한 유틸리티 집합입니다. 다양한 persister들를 사용하여 클라이