How to optimistically update onSucess not onMutation?
I've been trying to optimistically update a list when a create / delete mutation is actually successful in order to not wait for the invalidation refetch or deal with rollbacks and weird jumps. I'd rather have a spinner for the mutation and then immediately show on success. I've tried this in multiple ways (trpc + RQ in new integration) and whatever order i put things in it seems that most of the time it does not work, only occasionally it does and that seems completely random. But most of the time it just does not update the list at all.
The log shows up but no update of list. If i put invalidate before setQueryData or after it sometimes starts working sometimes not.
0 Replies