// Case 1 without invalidate
page_1_opened -> refresh query1
page_2_opened -> some mutations
page_1_opened -> refresh query1 // return old data
// Case 2 with invalidate
page_1_opened -> refresh query1
page_2_opened -> some mutations -> invalidate query1
page_1_opened -> refresh query1 // return fresh data
Provide the ability to mark queries as invalid
ref
tanstack/query
example api
use case
Update query after next query.refresh method call