@@ -971,9 +971,15 @@ engine supports.
971
971
972
972
GraphQL implementations should provide the ` @skip ` and ` @include ` directives.
973
973
974
+ GraphQL implementations that support the type system language must provide the
975
+ ` @deprecated ` directive when representing deprecated portions of the schema.
974
976
975
977
### @skip
976
978
979
+ ``` graphql
980
+ directive @skip (if : Boolean ! ) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
981
+ ```
982
+
977
983
The `@skip ` directive may be provided for fields , fragment spreads , and
978
984
inline fragments, and allows for conditional exclusion during execution as
979
985
described by the if argument.
@@ -990,6 +996,10 @@ query myQuery($someTest: Boolean) {
990
996
991
997
### @include
992
998
999
+ ``` graphql
1000
+ directive @include (if : Boolean ! ) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
1001
+ ```
1002
+
993
1003
The `@include ` directive may be provided for fields , fragment spreads , and
994
1004
inline fragments, and allows for conditional inclusion during execution as
995
1005
described by the if argument.
@@ -1011,6 +1021,31 @@ must *not* be queried if either the `@skip` condition is true *or* the
1011
1021
` @include ` condition is false.
1012
1022
1013
1023
1024
+ ### @deprecated
1025
+
1026
+ ``` graphql
1027
+ directive @deprecated (
1028
+ reason : String = " No longer supported"
1029
+ ) on FIELD_DEFINITION | ENUM_VALUE
1030
+ ```
1031
+
1032
+ 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
1033
+ deprecated enum values.
1034
+
1035
+ Deprecations include a reason for why it is deprecated, which can include
1036
+ markdown formatting.
1037
+
1038
+ In this example type definition, `oldField` is deprecated in favor of
1039
+ using `newField`.
1040
+
1041
+ ```graphql
1042
+ type ExampleType {
1043
+ newField : String
1044
+ oldField : String @deprecated (reason : "Use `newField`." )
1045
+ }
1046
+ ```
1047
+
1048
+
1014
1049
## Initial types
1015
1050
1016
1051
A GraphQL schema includes types, indicating where query, mutation, and
0 commit comments