apollographql / apollo-feature-requests

🧑‍🚀 Apollo Client Feature Requests | (no 🐛 please).
Other
130 stars 7 forks source link

Errors in queries triggered by useQuery's fetchMore don't propagate to the useQuery's error. #380

Open Samigirma1 opened 2 years ago

Samigirma1 commented 2 years ago

Hello! 🙂

TL;DR: It would be great if errors from failing fetchMore calls propagate to the error object returned by useQuery

I use useQuery for a list component and fetchMore to trigger cursor-based paginated calls. I noticed that when paginated calls fail, the error can only be accessed by catch the promise returned by fetchMore. It would be great if those errors also show up in the error object returned by useQuery. It helps avoids the complication of handling error states in the component.

jamesonhill commented 2 years ago

+1. @Samigirma1 Do you use fetchMore.updateQuery? I am seeing that if you use updateQuery, the error from calling fetchMore cannot be caught.