Intended outcome:
When a request made by useQuery fails, onError is fired
Actual outcome:
It never fires, whether it's a connection error, or a non-200 response
Version
@apollo/react-hooks 0.1.0-beta.10 (Can't get beta.11 to work at all due to #3270)
System:
OS: Windows 10
Binaries:
Node: 11.4.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.12.3 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 44.17763.1.0
npmPackages:
apollo-server-express: ^1.3.2 => 1.4.0
(This happens both on Windows and on a Linux Docker container though)
For me it seems to be the opposite. onError is actually executed three or four times. onError gets executed every time data or loading is updated.
Using version 0.1.0-beta.11.
@kasvtv @alfiehub Can you try @apollo/[email protected] and let me know if that helps? I'm having difficulty re-creating either of these issues, so if that doesn't help would you mind putting together a small runnable repro?
@hwillson I've forked a sandbox I found in another issue and tried to recreate the multiple onError calls problem using 0.1.0-beta.12.
https://codesandbox.io/s/apolloreact-hooks-multiple-onerror-calls-p1ifr
It seems to still be occurring as you can see in the console.
@hwillson I've forked a sandbox I found in another issue and tried to recreate the multiple
onErrorcalls problem using0.1.0-beta.12.
https://codesandbox.io/s/apolloreact-hooks-multiple-onerror-calls-p1ifrIt seems to still be occurring as you can see in the console.
For me on the sandbox on beta 11 it actually on fires once. But 12 It fires twice + the onCompleted gets fired.
I wonder whether it's because the of the cleanup function
Thanks for the reproduction @alfiehub - I'm looking into this now.
Most helpful comment
For me it seems to be the opposite.
onErroris actually executed three or four times.onErrorgets executed every timedataorloadingis updated.Using version
0.1.0-beta.11.