-
Notifications
You must be signed in to change notification settings - Fork 787
Move skip
out of options, and avoid calling props
and options
if it's false
#212
Comments
skip
option still calls props
optionskip: true
option still calls props
function
@stubailo it calls props to create the object sent to the client. If we didn't call it when I'm not opposed to this but need to think through what all it would remove. Just curious, do you have a use case where you don't want props() called? |
I thought the point of |
@stubailo thinking through this more. Right now
Thoughts? @stubailo |
Hmm, can't I use |
skip: true
option still calls props
functionskip
out of options, and avoid calling props
and options
if it's false
Another situation, if you have code like the below: export default FooWithData = graphql(query, {
options: ({foo}) => ({
skip: !foo,
variables: {
bar: foo.bar
}
})
})(Foo); It turns out that My proposed solution is now: graphql(query, {
skip: ({ foo }) => !foo,
options: ({ foo }) => ({ ... }),
});
|
Closing in favor of #245 |
I think if
skip: true
is passed, it should be as if this container doesn't exist at all. Right now, I have aprops
function that expects adata
object, and it's still called but without any data if I passskip: true
.The text was updated successfully, but these errors were encountered: