-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
I think its crucial to access cached data, at least while mutating.
lets say I have 2 endpoints - api/users & api/user/<id>
say i update api/user/<id>, i do not want to invalidate api/users, I would just like to mutate it, something like this - mutate('api/users', [...usersWithoutModifiedUser, modifiedUser])
the problem is.. I can't get the cached value for api/users at the time of the mutation.. since I only have the single user data I'm modifying.
I was thinking mutation api should look something like this
mutate('api/users', (cachedData) => {
... // using the cached data to build the new cached data.
return [...usersWithoutModifiedUser, modifiedUser];
})
Hope you understand my issue, looking forward hearing from you,
Thank you for the great lib.
Metadata
Metadata
Assignees
Labels
No labels