apollo-feature-requests icon indicating copy to clipboard operation
apollo-feature-requests copied to clipboard

allow retryLink to expose retries to the client

Open thumbsupep opened this issue 2 years ago • 1 comments

When a query errors, the retryLink silently continues to poll without notifying the UI in any way until all retries are complete. The UI is thus unaware it is potentially is displaying out-of-date information, and has no way of showing the user some sort of "retrying in X seconds" or "number of retries:" message.

Adding an onRetry callback to queries would be a potential solution.

thumbsupep avatar Jul 18 '23 18:07 thumbsupep

Hey @thumbsupep 👋

Thanks for the request! To make sure I'm understanding the ask here, are you thinking the API would look something like this?

import { RetryLink } from "@apollo/client/link/retry";

const link = new RetryLink({
  onRetry() {
    // do something when it retries
  }
});

jerelmiller avatar Jul 19 '23 03:07 jerelmiller