Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

add notifyOnLoadingStatusChange to fix issue #1347 #1438

Closed
wants to merge 11 commits into from

Conversation

tonyjiang88215
Copy link

@tonyjiang88215 tonyjiang88215 commented Dec 20, 2017

Closes #1347

Redefine function refetch() on the graphql hoc, and we do forceUpdate in this function and call the original refetch function.The graphql re-render can pass the right props through calling dataForChild();

Redefine function refetch() on the graphql hoc, and we do forceUpdate
in this function and call the original refetch function.
The graphql re-render can pass the right props through calling
dataForChild();
@apollo-cla
Copy link

@tonyjiang88215: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

TonyJiang and others added 8 commits December 21, 2017 12:23
       * redefine refetch function, if
option.notifyOnLoadingStatusChange is true, we forceUpdate
       * after calling original refetch to pass the new dataProps to
the wrappedComponent.
       * That can makes WrappedComponent be able to watch on loading
status;
add changlog
@tonyjiang88215
Copy link
Author

tonyjiang88215 commented Dec 21, 2017

At least version, i set up a notifyOnLoadingStatusChange in OperationOption, when notifyOnLoadingStatusChange=true, calling refetch function will re-render and pass the new loading status to the wrappedComponent.
If this is acceptable maybe such as fetchMore can do this either. ^ _ ^

@tonyjiang88215 tonyjiang88215 changed the title redefine refetch to fix issue #1347 add notifyOnLoadingStatusChange to fix issue #1347 Dec 21, 2017
@rosskevin
Copy link
Contributor

@tonyjiang88215 please note that I am not neglecting this PR, I simply am not familiar enough to make a call on it. @jbaxleyiii will be back soon, so I'll let him review.

@excitement-engineer any change we adopt here we should probably see how it impacts Query

@tonyjiang88215
Copy link
Author

@rosskevin thanks for feeding back.

In my option, i think the react-apollo is HOC that makes the React UI Component has the ability to use apollo-client and get the query(mutation) result in react-way, so i think its more convenient if the loading status or other status can pass to wrapped component reactively.

It`s all right if this PR is not accept , i can still do it in my project. : )

Thanks for the time again.

@jbaxleyiii
Copy link
Contributor

@tonyjiang88215 I think this is already supported by using notifyOnNetworkStatusChange in the options function? docs link here

@jbaxleyiii jbaxleyiii closed this Jan 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants