React-apollo: fetchMore pagination handle error?

Created on 29 Jan 2019  ·  2Comments  ·  Source: apollographql/react-apollo

Intended outcome:
Im trying to use fetchMore with react-infinite-scroll (https://www.npmjs.com/package/react-infinite-scroller). It works most of the times, but I want to be able to catch a server error and handle it. I am talking to a service that 'throttles' me a lot so what I do is I wait 1 sek and I try again.

Actual outcome:
It works perfectly except when the server responds with an error. What I want to do is catch that error but I havent been able to so far

image

How to reproduce the issue:
Create a query component
Call fetchMore with another query (to paginate)
Server returns some error

Version

Most helpful comment

For future ref, fetchMore returns a Promise so you can use .catch():

https://stackoverflow.com/questions/54437901/how-to-error-handle-in-fetchmore-pagination/56341411#56341411

All 2 comments

Issues here are reserved for bugs, but one of the following resources should help:

For future ref, fetchMore returns a Promise so you can use .catch():

https://stackoverflow.com/questions/54437901/how-to-error-handle-in-fetchmore-pagination/56341411#56341411

Was this page helpful?
0 / 5 - 0 ratings