Is there any way to invalidate the local cache or manually refetch useQuery?
Question from @Mikael Lirbank
4 Replies
I guess I should make the args reactive (state) and just update the input args to refresh?
useQuery
is already reactive. I'm curious in which scenario you're not getting updated values?I send a cookie via args and when the user sign out I need to refresh the current user query so the UI updates.
Eg getViewer returns the current user if the cookie is correct, and null if there is no cookie (or the cookie is invalid). Cookie = sessiontToken.
It's all good, I am adding a custom Contex+Provider to solve it.
Yup, that's the way to go! Sounds very similar to our Lucia template:
https://stack.convex.dev/convex-with-lucia
Custom Authentication (with Lucia)
Learn how to build a full stack app with authentication without any third-party auth providers, using Convex and the Lucia library.