-
Notifications
You must be signed in to change notification settings - Fork 787
loading
always true when re-render after error received from server
#1336
Comments
This issue has been automatically labled because it has not had recent activity. If you have not received a response from anyone, please mention the repository maintainer (most likely @jbaxleyiii). It will be closed if no further activity occurs. Thank you for your contributions to React Apollo! |
hey ! |
+1 |
2 similar comments
+1 |
+1 |
I am having this exact error! Here's the error template to reproduce it: https://github.com/dobesv/react-apollo-error-template/tree/error-disappearing If you run this and look in the logs you can see that the |
@jbaxleyiii This is happening both with refetch and polling features, as well. I see that most of the people commenting on the issue are using v2.x, but I'm experiencing this on react-apollo 1.4.16, also. |
+1 Any update on when is this gonna get fixed? |
+1 |
1 similar comment
+1 |
+1 |
This should be fixed in the current beta! |
+1 on v2.0.4 |
+1 on v2.1.5 |
+1 on 2.4.2 |
+1 on |
+1 on "react-apollo": "^2.5.4" |
Setting |
The original issue here should be resolved (thanks to #2718) in |
Simple todo list is rendered with data from server
where
todosQuery
is:When
withError
variable is set to true the error on server generated and query returns an error.Then this error is rendered in section of
Todos
component.The main react containers is contains following code
...so when
rerender
state is chaning all childrens of app are re-rendered.Intended outcome:
When re-render occures error should be still presented in returned data of
TodosWithData
Actual outcome:
Error is present in first render of component, but all subsequent renders are containing
loading
set to true, and noerror
ordata
props setted.How to reproduce the issue:
I create a reproduction app from
create-react-app
andapollo-server-express
(can be cloned from https://github.com/SkReD/apollo-demo.git)
To run it you need to start express server by
npm run start-server
command and then runwebpack-dev-server by command
npm start
.Then do following steps:
Investigation results
Looks like
currentResult
method ofObservableQuery
(link) is returning wrong result because it cannot findqueryStoreValue
for query and there is a logic thatloading
is set to true ifqueryStoreValue
is undefined, yet there islastError
presented, which contains actual error from server.Version
The text was updated successfully, but these errors were encountered: