fetchMore causes loading to be indefinitely true when getting an empty response #3468
Comments
Not sure if this would help anyone but I resolved this because my |
That is not my case, and everything was fine in version 3.0.1. I don't think this comes from my code. |
I'm also experiencing this issue. |
It seems like this happens when Forcing a render fixes it. |
I created a reproduction for this bug: https://codesandbox.io/s/reproduction-for-react-apollo-3468-jt3b5 P.S. I love using |
@dylanwulf I think your reproduction is for a different bug. This issue happens with a successful response of an empty array when no other data/state changes. |
@scf4 I am fairly confident that both issues are caused by the same bug, but just in case I created another reproduction with a successful response of empty array: https://codesandbox.io/s/reproduction-for-react-apollo-3468-with-successful-response-p4gmo |
@dylanwulf Oops, yeah I see what you're saying now. 👍 |
Same happens here, building pagination components and when I get a empty array response from the API the loading get stucked and it is not updated. |
It looks like a fix has been proposed but it has not been merged #3514 |
I am also experiencing the bug described by @scf4 . When I use I am experiencing this with: "react-apollo": "^3.0.1", |
#3514 has been merged, and will be deployed shortly. Thanks all! |
@hwillson have you deployed it? Because I still have this problem |
Intended outcome:
loading
being true while the fetchMore request is done, then merging the results withupdateQuery
, then rerendering withloading
to false.Actual outcome:
When fetchMore gets an empty array from the server,
updateQuery
is called as it should be, but the component never rerenders, thusloading
being indefinitely true.Version
@apollo/react-hooks : 3.1.0
The problem started with this version.
3.0.1 worked fine.
The text was updated successfully, but these errors were encountered: