diff --git a/cynic-book/src/derives/query-fragments.md b/cynic-book/src/derives/query-fragments.md index f56ed49bb..476f3d8e9 100644 --- a/cynic-book/src/derives/query-fragments.md +++ b/cynic-book/src/derives/query-fragments.md @@ -192,6 +192,26 @@ This `operation` can then be used in exactly the same way as with queries. +### Directives + +Directives can be provided using the `directive` attribute: + +``` +#[cynic( + graphql_type = "Root", + variables = "FilmQueryVariables" +)] +struct FilmQuery { + #[arguments(id: $id)] + #[directives(skip(if: $should_skip))] + film: Option, +} +``` + +Cynic provides build in support for the `skip` & `include` directives. Any +other field directives can also be used, provided they don't require special +support from the client. + #### Struct Attributes A QueryFragment can be configured with several attributes on the struct itself: