You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fragment on Story {
id
comments @include(if: $showComments) {
id
text
}
}
Then somewhere in the app I have a list of Stories. When $showComments is true everything works as expected. But when $showComments is false Relay sends additional GraphQL query for each story after initial load.
This query is sent to Node interface and includes this Story fragment (+child fragments if any) as well as id and __typename fields.
Relay currently passes through directives to the server but does not directly implement support for @include or @skip. We should add support such that:
unincluded fields (include: false or skip: true) are removed during diffing
reader does not return unincluded fields
Contributions welcome, otherwise we'll get to this as time permits.
I have following fragment:
Then somewhere in the app I have a list of
Stories
. When$showComments
istrue
everything works as expected. But when$showComments
isfalse
Relay sends additional GraphQL query for each story after initial load.This query is sent to
Node
interface and includes this Story fragment (+child fragments if any) as well asid
and__typename
fields.The response returned is always the same:
Same applies to
@skip(if: true)
directive.The text was updated successfully, but these errors were encountered: