-
Notifications
You must be signed in to change notification settings - Fork 787
Add networkStatus prop to connected components #322
Comments
@cannoneyed FYI, the |
I would like to implement this functionality since my app depends on it. @jbaxleyiii @cannoneyed @helfer Is anybody working on it now? |
@wizardzloy I'm starting to look into this now. |
@helfer @wizardzloy So what I've found so far is that there seems to be some work needed in This is an interesting situation. On the one hand, it totally makes sense that a |
+1 this feature will be very useful |
@cannoneyed I think we can implement this kind of tracking internally in Apollo Client and expose it just through a |
@helfer It would be for mine :) |
We've had the Is this a known effect of some other change that I missed, or should I open an issue for this? |
@czert are you using the query option |
@helfer thanks, I wasn't using the new |
networkStatus is included in props now |
Steps to Reproduce
When fetching more data, using a pattern identical to that proposed in the docs, the
loading
prop that is passed down to the wrapped component isfalse
afterfetchMore
is invoked.Buggy Behavior
It seems the
loading
prop is only ever tied to the initial load of data. For simple components that don't need to update or paginate, this is fine. However, the workaround for this (managing refetch / loadMore status with local component state) is not ideal.Expected Behavior
The following PR apollographql/apollo-client#707 in apollo client exposes a
networkStatus
object for handling the status of non-initial-load network requests, such as refetch, fetchMore, and subscriptions.It would be very nice to have the
networkStatus
object exposed as a prop to wrapped components (perhaps if specified as an option), so that paginated / more complex query operations loading/error state can be managed by the react-apollo wrapper rather than using local ad-hoc local component state.Version
The text was updated successfully, but these errors were encountered: