Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query Invalidation #481

Open
domosedov opened this issue Apr 15, 2024 · 0 comments
Open

Query Invalidation #481

domosedov opened this issue Apr 15, 2024 · 0 comments
Labels
scope:core type:enhancement New feature or request
Milestone

Comments

@domosedov
Copy link
Contributor

Provide the ability to mark queries as invalid

ref

tanstack/query

example api

invalidate(query, {
  triggers: [ev1, ev2]
})

invalidate([query1, ...queryN], {
  triggers: [ev1, ev2]
})

or

invalidate({
  queries: [query1, ...queryN],
  triggers: [ev1, ev2]
})

use case

Update query after next query.refresh method call

// 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
@igorkamyshev igorkamyshev added type:enhancement New feature or request scope:core labels Apr 15, 2024
@igorkamyshev igorkamyshev added this to the v1.0 milestone Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:core type:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants