-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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: set options for a query on setOptions in a queryObserver #4749
fix: set options for a query on setOptions in a queryObserver #4749
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 8c2d5b3:
|
All our tests are "e2e" tests because they mount a query on a page and then have buttons to interact with them. I think you could just write what your sandbox has and assert accordingly. However, what bothers me is that it seems like we have a test that tests exactly the opposite of what we're trying to achieve, and that's obviously failing now: query/packages/react-query/src/__tests__/useQuery.test.tsx Lines 2379 to 2401 in eeec5f7
|
fyi, the test was introduced here: |
Hm, I'm quite confused) First of all, that tests checks only queryFunc, not options. So, as I understand, we can save queryFunc between executions, but all other options can be updated? |
I think the test only checks for queryFn because queryFn is one of the valid options that live on the query itself. It could just as well check any other option. The PR description says:
|
I'm still confused a little( Looks like current behaviour (which is a bug for me) is a correct from react-query side =( |
I'll close this request. Looks like it is quite outdated and it is not so useful for the community) I'll watch for that issue by using v5 and I'll be back with a feedback) |
This PR attempts to close #3706
Opened questions
@TkDodo fyi, cause you have the context of the issue)