Implement optimistic updates with React Query for a "like" toggle on a post. Update the cache immediately, then revert on API failure.
Click Run to test your code