-
Notifications
You must be signed in to change notification settings - Fork 786
Refetch after error does not re-render the component #1466
Comments
@AWDGroup it would be great if you would PR a modification one of the tests (or add a new case) to prove the case. If you do, a fix is also welcome, but minimally a breaking test case is a big head start. |
@rosskevin I was doing more investigations on this and found out the following:
I'm not sure if this is by design or something is missing |
@rosskevin There is an existing comment in the code which is as follows:
|
We are currently lean on feedback from other contributors due to the holidays. I'm not yet familiar with the code, and the apollo-client docs don't make mention of rendering and rightfully so they are agnostic of the presentation framework. So - my uninformed opinion - this sounds like a bug. Assuming you are staying on the same view for refetching, if react-apollo allows you to refetch, it should re-render the data, otherwise what's the use case? |
I'm experiencing this issue as well -- When a component connected with the |
I'm having the same issue.
I confirm that the component doesn't update after
As a dirty workaround I manage to return a 200 status without errors in the response. |
I've reading several issues related with My case is related with the authentication. I'm using the The issue here is when the query returns an error because the user is not logged yet then the components are not subscribed to the query (I workarounded this not returning a network error and instead an error inside Another issue is that I can not use I think my problem would be solved if I use the Apollo Link State to subscribe my components locally to a query that I can read and write locally. I have realized that I can not delegate the component update to the network response or error. I hope this helps |
any update on this? |
+1 |
There are a couple workarounds posted in apollo-client issue 2153. Would like to get some feedback for the PR since this issue seems pretty widespread. |
Since the PR is in master, how long will it take for it to appear on npm? |
Looking for exactly this fix: need to propose user a way to re-establish connection during server errors. Confirming reproduction of the above. |
A fix or work around would be awesome. This flow seems common for most applications. |
This issue is older than the code change that I've identified as a problem, but for some, this could be the explanation of the problem you are seeing: #2070 |
Closing in favor of #2070 |
Intended outcome:
When I call refetch, I noticed that it actually makes the call to the server and grabs the data, but never calls the render on the component to update the data.
Actual outcome:
it should re-render the component
How to reproduce the issue:
I have the following component and I'm calling the refetch from the ErrorScreen Component
I have console.warn(this.props) in render function of both the parent component and the ErrorScreen Component, and non of them gets called when I call refetch():
Version
"apollo-cache-inmemory": "^1.1.4",
"apollo-client": "^2.0.4",
"apollo-client-preset": "^1.0.5",
"apollo-link-http": "^1.3.2",
"react-apollo": "^2.0.4",
The text was updated successfully, but these errors were encountered: