I would love the ability to define invalidations in my query/mutation definitions, so that queries can be automatically invalidated without having to call it manually on the client.
Example
Given a mutation called updateUser
and a query called getUser
. In the client right now, everywhere you call updateUser
, you need to remember to invalidate getUser
to prevent staleness.
Instead, it'd be great if this could be done automatically for you if your definition looks like so:
const usersRouter = router({
getUser: procedure.input(...).query(() => ...),
updateUser: procedure.input(...).invalidates('getUser').mutation(...)
});
n/a
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too