-
So the problem I'm having here is that all my useQuery functions are refetching when only one of them has that parameter set. Are settings for useQuery universal? How do I work around that? I only want one of them to refetch. Query 1 const { isLoading, isError, data, error } = useQuery({
queryKey: ['polls'],
queryFn: async () => {
const res = await axios.get(
'http://localhost:8080/polls/641dcf17a7b2a9a729fbe4cc'
);
return res;
},
refetchInterval: 2000,
}); Query 2 const { isLoading, isError, data, error, refetch } = useQuery({
queryKey: ['poll'],
queryFn: fetchPolls
}); |
Beta Was this translation helpful? Give feedback.
Answered by
TkDodo
Mar 25, 2023
Replies: 1 comment
-
I don't fully understand the question, but: extract it to a custom hook and enable interval with a param?
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Sannnji
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't fully understand the question, but: extract it to a custom hook and enable interval with a param?