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
{{ message }}
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
@Titozzz while working on a separate onCompleted issue, I've added a test to verify that onCompleted receives data properly when using cache-only. Everything appears to be working properly (with the latest soon to be published code). Can you take a look a the test in #3461 to see if I'm missing anything that could cause this to happen? I'll close this for now since everything appears to be okay, but let me know otherwise. Thanks!
Intended outcome / reproduction:
Types should be trustworthy but:
Using onCompleted(data), typescript says that data cannot be undefined, but onCompleted is called with undefined.
An easy way to reproduce is to do useQuery with cache-only.
Demo:
https://codesandbox.io/s/nifty-northcutt-0ukec
Either onCompleted should not be called when data is not in cache or type should warn that data can be undefined.
Type are specified as follow:
Version
System:
OS: macOS 10.14.4
Binaries:
Node: 12.7.0 - ~/.nvm/versions/node/v12.7.0/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.10.0 - ~/.nvm/versions/node/v12.7.0/bin/npm
Browsers:
Chrome: 76.0.3809.132
Safari: 12.1
npmPackages:
apollo: 2.17.2 => 2.17.2
@apollo/react-hooks: 3.0.1
The text was updated successfully, but these errors were encountered: