@@ -1875,6 +1875,10 @@ A GraphQL schema describes directives which are used to annotate various parts
1875
1875
of a GraphQL document as an indicator that they should be evaluated differently
1876
1876
by a validator , executor , or client tool such as a code generator .
1877
1877
1878
+ **Built -in Directives **
1879
+
1880
+ :: A *built -in directive * is any directive defined within this specification .
1881
+
1878
1882
GraphQL implementations should provide the `@skip ` and `@include ` directives .
1879
1883
1880
1884
GraphQL implementations that support the type system definition language must
@@ -1885,23 +1889,25 @@ GraphQL implementations that support the type system definition language should
1885
1889
provide the `@specifiedBy ` directive if representing custom scalar
1886
1890
definitions .
1887
1891
1888
- When representing a GraphQL schema using the type system definition language ,
1889
- built in directives (any defined in this specification) should be omitted for
1890
- brevity . Custom directives in use must be specified .
1892
+ When representing a GraphQL schema using the type system definition language
1893
+ any *built -in directive * may be omitted for brevity .
1894
+
1895
+ When introspecting a GraphQL service all provided directives , including
1896
+ any *built -in directive *, must be included in the set of returned directives .
1891
1897
1892
1898
**Custom Directives **
1893
1899
1894
- GraphQL services and client tooling may provide additional directives beyond
1895
- those defined in this document . Directives are the preferred way to extend
1896
- GraphQL with custom or experimental behavior .
1897
-
1898
- Note : When defining a directive , it is recommended to prefix the directive ' s
1899
- name to make its scope of usage clear and to prevent a collision with directives
1900
- which may be specified by future versions of this document (which will not
1901
- include `_` in their name). For example , a custom directive used by Facebook ' s
1902
- GraphQL service should be named `@fb_auth ` instead of ` @auth `. This is
1903
- especially recommended for proposed additions to this specification which can
1904
- change during the [RFC process ](https ://github .com /graphql /graphql -spec /blob /main /CONTRIBUTING .md ).
1900
+ :: GraphQL services and client tooling may provide any additional
1901
+ * custom directive * beyond those defined in this document . Directives are the
1902
+ preferred way to extend GraphQL with custom or experimental behavior .
1903
+
1904
+ Note : When defining a * custom directive * , it is recommended to prefix the
1905
+ directive ' s name to make its scope of usage clear and to prevent a collision
1906
+ with * built - in directive * which may be specified by future versions of this
1907
+ document (which will not include `_` in their name). For example , a
1908
+ * custom directive * used by Facebook ' s GraphQL service should be named `@fb_auth `
1909
+ instead of ` @auth `. This is especially recommended for proposed additions to
1910
+ this specification which can change during the [RFC process ](https ://github .com /graphql /graphql -spec /blob /main /CONTRIBUTING .md ).
1905
1911
For example a work in progress version of `@live ` should be named `@rfc_live `.
1906
1912
1907
1913
Directives must only be used in the locations they are declared to belong in .
@@ -1986,9 +1992,9 @@ repeatable directives.
1986
1992
directive @skip (if : Boolean !) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
1987
1993
```
1988
1994
1989
- The `@skip ` directive may be provided for fields , fragment spreads , and
1990
- inline fragments , and allows for conditional exclusion during execution as
1991
- described by the if argument .
1995
+ The `@skip ` * built - in directive * may be provided for fields , fragment spreads ,
1996
+ and inline fragments , and allows for conditional exclusion during execution as
1997
+ described by the ` if ` argument .
1992
1998
1993
1999
In this example `experimentalField ` will only be queried if the variable
1994
2000
`$someTest ` has the value `false `.
@@ -2006,9 +2012,9 @@ query myQuery($someTest: Boolean!) {
2006
2012
directive @include (if : Boolean !) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
2007
2013
```
2008
2014
2009
- The `@include ` directive may be provided for fields , fragment spreads , and
2010
- inline fragments , and allows for conditional inclusion during execution as
2011
- described by the if argument .
2015
+ The `@include ` * built - in directive * may be provided for fields , fragment
2016
+ spreads , and inline fragments , and allows for conditional inclusion during
2017
+ execution as described by the ` if ` argument .
2012
2018
2013
2019
In this example `experimentalField ` will only be queried if the variable
2014
2020
`$someTest ` has the value `true `
@@ -2035,8 +2041,8 @@ directive @deprecated(
2035
2041
) on FIELD_DEFINITION | ENUM_VALUE
2036
2042
```
2037
2043
2038
- The `@deprecated ` directive is used within the type system definition language
2039
- to indicate deprecated portions of a GraphQL service 's schema , such as
2044
+ The `@deprecated ` * built - in directive * is used within the type system definition
2045
+ language to indicate deprecated portions of a GraphQL service 's schema , such as
2040
2046
deprecated fields on a type or deprecated enum values .
2041
2047
2042
2048
Deprecations include a reason for why it is deprecated , which is formatted using
@@ -2059,10 +2065,10 @@ type ExampleType {
2059
2065
directive @specifiedBy (url : String !) on SCALAR
2060
2066
```
2061
2067
2062
- The `@specifiedBy ` directive is used within the type system definition language
2063
- to provide a *scalar specification URL * for specifying the behavior of
2064
- [custom scalar types ](#sec-Scalars.Custom-Scalars). The URL should point to a
2065
- human-readable specification of the data format, serialization, and
2068
+ The `@specifiedBy ` * built - in directive * is used within the type system
2069
+ definition language to provide a *scalar specification URL * for specifying the
2070
+ behavior of [custom scalar types ](#sec-Scalars.Custom-Scalars). The URL should
2071
+ point to a human-readable specification of the data format, serialization, and
2066
2072
coercion rules. It must not appear on built-in scalar types.
2067
2073
2068
2074
In this example, a custom scalar type for `UUID` is defined with a URL pointing
0 commit comments