-
Notifications
You must be signed in to change notification settings - Fork 787
does 'refetch' suppose to update data props? #1391
Comments
I'm having this issue too. When you call a refetch it returns a promise. When the promise is resolved you get the data, errors, networkStatus, etc. But those fields should have updated the component props, IMO. |
@kdong007 if you're still having trouble with data.refetch, you should checkout apollographql/apollo-client#2513 .The solution of @adambom helped. |
@alewiahmed that works. refetch -> retry :D |
@kdong007 if you keep scrolling down I came up with a better workaround that allows you to continue using refetch instead of retry. I published it under the package react-apollo-temp-adambom if you want to try that |
@adambom just found an issue with the fix. First you get an error state for the component, and then update some props of the component, data.loading become true and data.error is cleared. I tracked the issue down to apollo-client, the issue is related to unsubribe/create query, so the old error result is removed by tearDownQuery() |
@kdong007 Can you provide repro steps and include line numbers of the code you're referencing? I'll do my best to address the issue if possible if you're able to provide some more information, but it was really only meant to be a hack, so there may be a better way of addressing the problem. |
Closing - housekeeping - ping me if it needs to be reopened. |
seems calling props.data.refetch only returns a promise but not update the component. Is this as designed or a bug?
The text was updated successfully, but these errors were encountered: