From d68dac64a1dbb3fa4ca1aa79debc92b70b3c0c20 Mon Sep 17 00:00:00 2001 From: Briggs Date: Wed, 23 Oct 2019 11:26:05 -0400 Subject: [PATCH] The @skip and @include should match spec The @skip and @include directives do not are not defined per the spec as their "if" fields are shown as nullable. They should be set to non-null. --- site/learn/Learn-Queries.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/learn/Learn-Queries.md b/site/learn/Learn-Queries.md index 255ddc7fbb..f7f3349aa8 100644 --- a/site/learn/Learn-Queries.md +++ b/site/learn/Learn-Queries.md @@ -258,8 +258,8 @@ Try editing the variables above to instead pass `true` for `withFriends`, and se We needed to use a new feature in GraphQL called a _directive_. A directive can be attached to a field or fragment inclusion, and can affect execution of the query in any way the server desires. The core GraphQL specification includes exactly two directives, which must be supported by any spec-compliant GraphQL server implementation: -- `@include(if: Boolean)` Only include this field in the result if the argument is `true`. -- `@skip(if: Boolean)` Skip this field if the argument is `true`. +- `@include(if: Boolean!)` Only include this field in the result if the argument is `true`. +- `@skip(if: Boolean!)` Skip this field if the argument is `true`. Directives can be useful to get out of situations where you otherwise would need to do string manipulation to add and remove fields in your query. Server implementations may also add experimental features by defining completely new directives.