@SKIP and @INCLUDE Directives

The directives @skip and @include allow conditional inclusion of fields at query time.

  • @skip(if: <Boolean>): When the if condition is TRUE, the field is omitted from the output; when FALSE, the field is returned.

  • @include(if: <Boolean>): When the if condition is TRUE, the field is returned; when FALSE, the field is omitted.

Limitations:While @skip and @include accept a Boolean if argument, using GraphQL variables as the if argument is not supported. The condition must be specified as a constant Boolean expression in the query text.