You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the link responds without a delay (it may be a Promise, but it cannot use setTimeout) - like a caching mechanism, mock, etc.
Intended outcome:
The query is executed and results are displayed
Actual outcome:
The query is executed, but results are not displayed - they're "loading" forever
Switching the skip again to true and false again works as intended.
Click the toggle skip - you should see the results, but you'll see the "Loading..." screen. If you change the version of the package to beta.14 - it will work again.
Versions
3.0.0-beta.29
The 3.0.0-beta.14 works as expected, so regression was introduced in beta.15.
Currently, when the result of the query arrives, the previousOptions still holds skip: true - therefore the result is ignored. previousOptions are set by the hook with afterExecute, but it seems that this is too late for this skipping logic to work as intended.
The text was updated successfully, but these errors were encountered:
In a situation where:
skip: true
skip
to falsesetTimeout
) - like a caching mechanism, mock, etc.Intended outcome:
The query is executed and results are displayed
Actual outcome:
The query is executed, but results are not displayed - they're "loading" forever
Switching the
skip
again totrue
andfalse
again works as intended.How to reproduce the issue:
See this sandbox for a reproduction:
https://codesandbox.io/s/goofy-spence-0l96j
Click the
toggle skip
- you should see the results, but you'll see the "Loading..." screen. If you change the version of the package tobeta.14
- it will work again.Versions
3.0.0-beta.29
The 3.0.0-beta.14 works as expected, so regression was introduced in beta.15.
Potential Solution
I was able to fix this by checking
this.options.skip
in this line instead:https://github.com/apollographql/apollo-client/blob/master/src/react/data/QueryData.ts#L296
Currently, when the result of the query arrives, the
previousOptions
still holdsskip: true
- therefore the result is ignored.previousOptions
are set by the hook withafterExecute
, but it seems that this is too late for this skipping logic to work as intended.The text was updated successfully, but these errors were encountered: