Use case:
Workaround: I currently choose to avoid rendering the
Proposal: add a skip prop to the
@abenhamdine I'm referring to the new <Query/> component that uses render props, not the graphql container HOC (maybe I should make that clearer in the issue description).
AFAIK, the link you provided details the "skip" option for the later.
I'm referring to the new
component that uses render props, not the graphql container HOC (maybe I should make that clearer in the issue description).
Oh yes, sorry, I realized after having posted that you were referring to the Query component.
Nethertheless, perhaps it would be useful to explain if your proposal is the equivalent (or not equivalent, and so why) of the HOC skip property, to be clearer for everyone.
I would also really appreciate a skip property that is equivalent to the HOC's skip property. ie, we should still render the underlying component (children here), but not execute the query.
I'm currently working around this by setting fetchPolicy={skip() ? 'cache-only' : undefined}
It's not a perfect recreation of the functionality, but it at least reduces the number of network requests which is a good portion of what I want.
I think this property would be useful, too.
In real world web apps you often need to skip queries for not-logged users to avoid useless not-authenticated errors.
Thank you,
Matteo
This feature should be available on 2.1.0-beta.3. Check out this PR for more info: https://github.com/apollographql/react-apollo/pull/1715
Most helpful comment
This feature should be available on 2.1.0-beta.3. Check out this PR for more info: https://github.com/apollographql/react-apollo/pull/1715