Replies: 1 comment 1 reply
-
seems like you have a stateful session in the backend. you can clear the cache ( |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm just starting with TanStack query and I don't know whether the currently logged in user should be added to the query key of some of my useQuery hook calls?
I use an auth mechanism that spans across the client/server and I do not need to specify the user as a parameter to my API calls. So when my API receives a "getTodos" with no parameters, it knows who the user is and only returns the todo items for this user. I believe this is pretty standard.
Since TanStack query caches the requests based on the key, isn't there a risk that if user1 logs out and user2 logs in from the same browser, the cached data from user1 could be returned to user2?
What is best practice for determining the query key, when the currently logged in user is implied and not used in the query?
Beta Was this translation helpful? Give feedback.
All reactions