fl-query
fl-query copied to clipboard
Fix: prevent refresh when query is disabled #38
Would appreciate it if you could check over it and suggest changes @PetrKubes97
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.
Yeah, the query's refresh config should take precedence over the query client's right?
So how should we go about enforcing that?
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.