Extensions ReferenceConditional Field Manipulation
Conditional Field Manipulation
Addition of meta directives @if
and @unless
to the GraphQL schema, to conditionally execute a nested directive on the field.
@if
@if
executes its nested directives only if a condition has value true
.
In this query, users "Leo"
and "Peter"
get their names converted to upper case, since they are in the "special user" array, while "Martin"
does not:
...producing:
@unless
Similar to @if
, but it executes the nested directives when the condition is false
.
In this query, it is user "Martin"
who gets the name converted to upper case, while the other ones do not:
...producing: