Apollo-client: Update networkStatus when fetchMore is happening

Created on 28 Oct 2016  Â·  9Comments  Â·  Source: apollographql/apollo-client

Continuation of #827.

Also consider calculating loading state based on networkStatus.

Most helpful comment

@svrcekmichal ok, makes sense. I'll try to get this shipped in the near future.

All 9 comments

Oh, finally found it. This one missing feature is killing my app, so no need to create new issue. For now I'm staying with previous versions.

@svrcekmichal Can you share your use-case? Depending on how compelling it is, I might prioritize this feature.

I'm using neverending scroll on one of pages, and I'm using loading status in fetchMore to prevent duplicate fetching.

And you would do that by graying out the "load more" button or prevent automatic fetching if the networkStatus is "fetchingMore"?

@helfer I'm listening to scroll event and if user scroll bellow point, I'm fetching more. Then i use loading status from fetchingMore to indicate that something is loading and also if if user scroll up the point and again bellow point I'm preventing duplicite loading of same page

@svrcekmichal ok, makes sense. I'll try to get this shipped in the near future.

This feature is also very important to our app, I would love to receive the "fetchingMore" flag in the wrapped component during the infinite scroll.

I would also love to know when more data is being fetched so I'm able to show a loading spinner. I tried using networkStatus but it always returns 7 no matter what for some reason…

I've been experimenting with the two patterns for pagination (incremental with fetchMore and non-incremental by changing the pagination arguments directly, see https://github.com/apollostack/apollo-client/issues/1087) and I can confirm that when doing non-incremental pagination networkStatus correctly changes to 2 while data is reloading, but when using fetchMore it stays at 7 the whole time.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MichaelDeBoey picture MichaelDeBoey  Â·  3Comments

eweilow picture eweilow  Â·  3Comments

NeoPhi picture NeoPhi  Â·  3Comments

stubailo picture stubailo  Â·  3Comments

canercandan picture canercandan  Â·  3Comments