-
Notifications
You must be signed in to change notification settings - Fork 793
useQuery: on using refetch, 'loading' keeps true when same error returned twice or more #3395
Comments
I think the following code is not working as expected...
(it seems that equal from @wry/equality does only compares name and message for Error object: https://github.com/benjamn/wryware/blob/master/packages/equality/src/equality.ts#L72 )
|
I confirm the issue. |
❗️ Important notice: When I change version of @apollo/react-hooks from 3.0.1 to 3.0.0 the issue is not reproducing. |
I struggle with the same issue but it's not really related to I made codesandbox that shows this issue: https://codesandbox.io/s/react-apollo-3x-and-loading-true-i7ub1 This issue doesn't exist when |
Looks like a blocker for me. |
Could someone here re-test using React Apollo 3.1.0 and let us know if this is still an issue? Thanks! |
@hwillson I tried with react-apollo@3.1.0, but (unfortunately) the problem still occurs.
Thanks! |
@hwillson This issue still exists https://codesandbox.io/s/react-apollo-310-and-loading-true-tl1x0 |
When using
refetch
method on the return value ofuseQuery
, and an error returned with the samename
andmessage
for the previous error,loading
value of the return value keepstrue
(not changes tofalse
), even ifnotifyOnNetworkStatusChange
option istrue
.Intended outcome:
loading
changes tofalse
whenever an error returnedActual outcome:
loading
keepstrue
when the same error returned (though it changes tofalse
on the first error)How to reproduce the issue:
I created an repository with the reproduction code here:
https://github.com/jet2jet/react-apollo-test
After build and open
dist/index.html
, when clicking 'Refetch' at first, an error data will be shown. But when clicking 'Refetch' on the third time (callCount = 4
on the log), 'Loading...' will be shown (an error data should be shown on this time).Version
Note: I think this problem might not occur with react-apollo: 3.0.0
npmPackages:
apollo-cache-inmemory: ^1.6.3 => 1.6.3
apollo-client: 2.6.4 => 2.6.4
react-apollo: 3.0.1 => 3.0.1
The text was updated successfully, but these errors were encountered: