Skip to content

Commit d68dac6

Browse files
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.
1 parent e49eb0b commit d68dac6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

site/learn/Learn-Queries.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ Try editing the variables above to instead pass `true` for `withFriends`, and se
258258

259259
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:
260260

261-
- `@include(if: Boolean)` Only include this field in the result if the argument is `true`.
262-
- `@skip(if: Boolean)` Skip this field if the argument is `true`.
261+
- `@include(if: Boolean!)` Only include this field in the result if the argument is `true`.
262+
- `@skip(if: Boolean!)` Skip this field if the argument is `true`.
263263

264264
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.
265265

0 commit comments

Comments
 (0)