-
Notifications
You must be signed in to change notification settings - Fork 786
useQuery's onError callback is never fired #3287
Comments
For me it seems to be the opposite. Using version |
@kasvtv @alfiehub Can you try |
@hwillson I've forked a sandbox I found in another issue and tried to recreate the multiple It 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. |
1. It prevents the `onError` callback from unnecessarily being called multiple times in a row. 2. It migrates all peer and dev deps to use `apollo-client` 2.6.4. Apollo Client 2.6.4 provides a fix for last result error tracking (apollographql/apollo-client@c44e821), which fixes the long standing React Apollo issue of `refetch` not setting `loading` state properly. Calling `refetch` will now first set `loading` to `true`. These fixes are bundled together, as verifying that `onError` is working properly requires being able to make sure results after a refetch that don't have an error, are handled properly. Fixes #3331. Fixes #3287. Fixes #2559. Fixes #321. (and probably fixes others!)
) * This commit helps address 2 main issues: 1. It prevents the `onError` callback from unnecessarily being called multiple times in a row. 2. It migrates all peer and dev deps to use `apollo-client` 2.6.4. Apollo Client 2.6.4 provides a fix for last result error tracking (apollographql/apollo-client@c44e821), which fixes the long standing React Apollo issue of `refetch` not setting `loading` state properly. Calling `refetch` will now first set `loading` to `true`. These fixes are bundled together, as verifying that `onError` is working properly requires being able to make sure results after a refetch that don't have an error, are handled properly. Fixes #3331. Fixes #3287. Fixes #2559. Fixes #321. (and probably fixes others!) * Changelog update * Silence extra CI warnings to troubleshoot test issues
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 getbeta.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)
The text was updated successfully, but these errors were encountered: