@@ -895,9 +895,15 @@ engine supports.
895
895
896
896
GraphQL implementations should provide the ` @skip ` and ` @include ` directives.
897
897
898
+ GraphQL implementations that support the type system language must provide the
899
+ ` @deprecated ` directive when representing deprecated portions of the schema.
898
900
899
901
### @skip
900
902
903
+ ``` graphql
904
+ directive @skip (if : Boolean ! ) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
905
+ ```
906
+
901
907
The `@skip ` directive may be provided for fields , fragment spreads , and
902
908
inline fragments, and allows for conditional exclusion during execution as
903
909
described by the if argument.
@@ -914,6 +920,10 @@ query myQuery($someTest: Boolean) {
914
920
915
921
### @include
916
922
923
+ ``` graphql
924
+ directive @include (if : Boolean ! ) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
925
+ ```
926
+
917
927
The `@include ` directive may be provided for fields , fragment spreads , and
918
928
inline fragments, and allows for conditional inclusion during execution as
919
929
described by the if argument.
@@ -935,6 +945,31 @@ must *not* be queried if either the `@skip` condition is true *or* the
935
945
` @include ` condition is false.
936
946
937
947
948
+ ### @deprecated
949
+
950
+ ``` graphql
951
+ directive @deprecated (
952
+ reason : String = " No longer supported"
953
+ ) on FIELD_DEFINITION | ENUM_VALUE
954
+ ```
955
+
956
+ The `@deprecated ` directive is used within the type system language to indicate deprecated portions of the schema , such as deprecated fields on a type or
957
+ deprecated enum values.
958
+
959
+ Deprecations include a reason for why it is deprecated, which can include
960
+ markdown formatting.
961
+
962
+ In this example type definition, `oldField` is deprecated in favor of
963
+ using `newField`.
964
+
965
+ ```graphql
966
+ type ExampleType {
967
+ newField : String
968
+ oldField : String @deprecated (reason : "Use `newField`." )
969
+ }
970
+ ```
971
+
972
+
938
973
## Initial types
939
974
940
975
A GraphQL schema includes types, indicating where query and mutation
0 commit comments