File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Directives
2
+
3
+ Directives in GraphQL are extensible annotations which alter the runtime
4
+ evaluation of a query or which add information to the ` schema ` definition.
5
+ They always begin with an ` @ ` . There are three built-in directives which this
6
+ library automatically handles:
7
+
8
+ 1 . ` @include(if: Boolean!) ` : Only resolve this field and include it in the
9
+ results if the ` if ` argument evaluates to ` true ` .
10
+ 2 . ` @skip(if: Boolean!) ` : Only resolve this field and include it in the
11
+ results if the ` if ` argument evaluates to ` false ` .
12
+ 3 . ` @deprecated(reason: String) ` : Mark the field or enum value as deprecated
13
+ through introspection with the specified ` reason ` string.
14
+
15
+ The ` schema ` can also define custom ` directives ` which are valid on different
16
+ elements of the ` query ` . The library does not handle them automatically, but it
17
+ will pass them to the ` getField ` implementations through the
18
+ ` graphql::service::FieldParams ` struct (see [ fieldparams.md] ( fieldparams.md )
19
+ for more information).
You can’t perform that action at this time.
0 commit comments