-
Notifications
You must be signed in to change notification settings - Fork 787
Fix query result when skip=true (#1869) #1916
Conversation
Not sure what's up with that failing test. Is it because of the changes in this PR? |
Any progress on this? |
Ran into this issue yesterday, can a maintainer chime in here? I really like the |
@edorivai care to merge |
@k00k I've merged back in, seems like all checks passed. As far as I know this PR should be good to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All checks pass. Looks clean.
src/Query.tsx
Outdated
// When skipping a query (ie. we're not querying for data but still want | ||
// to render children), make sure the `data` is cleared out and | ||
// `loading` is set to `false` (since we aren't loading anything). | ||
if (this.props.skip) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick note here - I've re-arranged this a bit to short circuit un-necessary extra query logic, when the query is to be skipped. One thing to add though, is that this means we're leaving networkStatus
as undefined
. This is currently intentional, as setting this to NetworkStatus.ready
can cause problems when using something like the graphql
hoc and calculating the skip
value using a function (forcing a NetworkStatus.ready
value can prematurely end rendering). Leaving networkStatus
as undefined
here seems to be okay though, and is better than the way it was before when we did the skip
check at the end of getQueryResult
. That left networkStatus
in NetworkStatus.loading
state, even though we weren't loading anything.
What's the status on this one? Seems like it's good to go (besides conflicts). |
We've run into this issue as well and would really appreciate it being merged in. 😃 |
Please resolve conflicts, otherwise I think this good to merge |
@hwillson are you picking up the conflicts, or would you like me to do it? |
@edorivai I'll take care of it shortly. Thanks! |
Is anyone taking care of this? |
@hwillson What's the status on this? We've been greatly affected by this for quite some time now. |
@hwillson what is the status of resolving these conflicts and merging this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're good to go here @edorivai - sorry for the long delay, and thanks for working on this!
Great to hear 🎉 |
SO you just fixed this issue for Component, and for HOC not, right? |
Should fix #1869
I added a test case, and took the implementation from the original PR that aimed to implement the
skip
prop on<Query>
.I suspect this piece of logic got lost in the big rewrite mentioned here.
Checklist: