Skip to content

Why have per-item tags, if edit causes the entire list to re-fetch #5009

Answered by phryneas
rpasechnikov asked this question in Q&A
Discussion options

You must be logged in to vote

The job of RTK Query is to deal with all kinds of REST endpoints - and most REST endpoints are designed in a way that doesn't lend itself to things like normalization, so something like a "partial refetch" is impossible.
It's a deliberate design choice that RTK Query only tries to mirror the state of the server, and refetches endpoints it knows are outdated in the browser.

Things like normalization work better in a client that can make very specific assumptions about the API, e.g. a GraphQL client like Apollo Client - and in those cases you can also do selective cache updates and/or refetches.

But a general API client like RTK Query cannot make any of those assumptions, so it has to fall …

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@phryneas
Comment options

@rpasechnikov
Comment options

@phryneas
Comment options

@rpasechnikov
Comment options

Answer selected by rpasechnikov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants