Skip to content

What is the recommended way to prevent query cache pollution from conditionally disabled queries? #9257

Answered by TkDodo
blindbeat asked this question in Q&A
Discussion options

You must be logged in to vote

to prevent pollution of the query cache

that behaviour is by design and not something you should worry about / try to limit. The only alternative is not calling useQuery, which means rendering a component conditionally:

if (organisationId && modelId) {
  return <MyComponentThatCallsUseQueryUnconditionally />
}

maybe we could add a filter to the devtools? We already have them labelled as disabled...

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@blindbeat
Comment options

@blindbeat
Comment options

Answer selected by blindbeat
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