React Query setQueryData in 10 minutes

Опубликовано: 27 Июль 2026
на канале: Har Pal Coding
564
7

In this video we will talk about how we can update local cache in react query using queryClient.setQueryData. Normally devs use refetch to update query cache whenever a mutation occurs on the backend but it is very network expensive if you have many records which is in a lot of cases. setQueryData allows us to update cache data locally without doing any external requests by using the response we get back from the mutation. In this video we will see how we can change query data whenever we delete, update or create a record.