apollographql/apollo-link

I cannot get it running

Open

#834 opened on Oct 19, 2018

View on GitHub
 (1 comment) (0 reactions) (0 assignees)TypeScript (335 forks)auto 404
good first issue

Repository metrics

Stars
 (1,427 stars)
PR merge metrics
 (PR metrics pending)

Description

Expected Behavior As far as i understood the docs here, i should just:

  • install the npm module
  • add it to my existing array of apollo-links, preverably after my existing "onError" catch
  • having fun with retries

Actual Behavior

  • It's not retrying anything
  • Without onError, still not working
  • I thought maybe it's because we were not "forwarding" anything in onError, added "return forward(operation)", still not working
  • If the RetryLink is the last link in the array, following Exception occurs this.nextLink is not a function
  • I added logs everywhere in the "apollo-link-retry" package locally installed in my node_modules.. what i see there is that -- every single query starts a "retry", no matter if it has an error or not, but most of them get "cancelled" again -- also the queries with an error inside and which are getting a Retriable Class instance too, are getting cancelled too, no idea why -- my "retryIf" method is never getting called

A simple reproduction Add the "retry" link to an existing project working with apollo-client and following links:

  • ApolloLink from 'apollo-link'
  • onError from 'apollo-link-error'
  • BatchHttpLink from 'apollo-link-batch-http'
  • Break one of your Queries on GraphQL server, so it should retry that one
  • Check your network tab, you only see the broken query request with the error and no further ones, so no retry is happening

i cannot share our project as it is a huge commercial e-commerce platform..

Issue Labels

  • has-reproduction
  • feature
  • docs
  • blocking
  • good first issue

I'm missing examples in the doc for following questions:

  • Is the order important inside an existing "apollo-link" array? Guess yes with my experience so far, nothing written about that
  • What are reasons why "retryIf" is not getting called? Seems i'm missing a few important points here
  • Why does it need to be the last link in my array?
  • Are further retry-queries/POST requests somehow flagged that it is a retry-request? I cannot check this as i never managed to get an actual retry-request working..

Contributor guide