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

Fix: prevent refresh when query is disabled #38 #53

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ganeshh123
Copy link

Would appreciate it if you could check over it and suggest changes @PetrKubes97

@PetrKubes97
Copy link
Collaborator

Thanks for the PR. Sorry, I think I've led you in the wrong direction.

Looking at the code now, I'm thinking the following scenario:

  • I set enabled to false
  • I set refreshOnMount to true in the query client
  • I fetch the query (--> it is enabled now)
  • remount --> I would expect the query to refresh

You've also written:

Setting refreshOnMount explicitly doesn't seem to work on the disabled query either, it gets overriden by the QueryClientProvider it seems.

If useQuery(refreshConfig) gets overriden, it's definitely a bug.

@ganeshh123
Copy link
Author

Yeah, the query's refresh config should take precedence over the query client's right?

So how should we go about enforcing that?

@PetrKubes97
Copy link
Collaborator

I've taken a quick look at the code and I don't see any obvious mistakes.

A good first step would be to create an sample that reproduces the issue, for example in the examples folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants