🤔 Forcing a Refresh in TanStack Query with Convex: How to Do It?
I set up TanStack Query with Convex Query, and everything works fine by following the documentation. However, one thing I noticed is that Convex/TanStack Query doesn't require a forced refresh. I need to force a refresh for a specific purpose. Can anyone guide me on how to do that?
4 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
I followed the docs and set up basic queries successfully. I created a few queries, but I need to force a refetch. I tried
queryClient.invalidateQueries
, queryClient.refetchQueries
, and refetch
, but none of them are working to refetch the Convex query function. Any suggestions?
https://docs.convex.dev/client/tanstack-query#:~:text=TanStack%20Query%20is%20an%20excellent,for%20use%20with%20TanStack%20Query.Convex with TanStack Query | Convex Developer Hub
TanStack Query is an excellent, popular
Did u find the solution? I am having the same problem
Are you saying queries return an initial value but don't update when the underlying result has changed? Is it all queries or some? Any working vs non-working code you can share will help.