@@ -38,9 +38,73 @@ local service to represent data a GraphQL client only accesses locally, or by a
38
38
GraphQL service which is itself an extension of another GraphQL service.
39
39
40
40
41
+ ## Descriptions
42
+
43
+ Description : StringValue
44
+
45
+ Documentation is a first-class feature of GraphQL type systems. To ensure
46
+ the documentation of a GraphQL service remains consistent with its capabilities,
47
+ descriptions of GraphQL definitions are provided alongside their definitions and
48
+ made available via introspection.
49
+
50
+ To allow GraphQL service designers to easily publish documentation alongside the
51
+ capabilities of a GraphQL service, GraphQL descriptions are defined using the
52
+ Markdown syntax (as specified by [ CommonMark] ( https://commonmark.org/ ) ). In the
53
+ type system definition language, these description strings (often {BlockString})
54
+ occur immediately before the definition they describe.
55
+
56
+ GraphQL schema and all other definitions (e.g. types, fields, arguments, etc.)
57
+ which can be described should provide a {Description} unless they are considered
58
+ self descriptive.
59
+
60
+ As an example, this simple GraphQL schema is well described:
61
+
62
+ ``` graphql example
63
+ """
64
+ A simple GraphQL schema which is well described.
65
+ """
66
+ schema {
67
+ query : Query
68
+ }
69
+
70
+ """
71
+ Root type for all your queries
72
+ """
73
+ type Query {
74
+ """
75
+ Translates a string from a given language into a different language.
76
+ """
77
+ translate (
78
+ "The original language that `text` is provided in."
79
+ fromLanguage : Language
80
+
81
+ "The translated language to be returned."
82
+ toLanguage : Language
83
+
84
+ "The text to be translated."
85
+ text : String
86
+ ): String
87
+ }
88
+
89
+ """
90
+ The set of languages supported by `translate`.
91
+ """
92
+ enum Language {
93
+ "English"
94
+ EN
95
+
96
+ "French"
97
+ FR
98
+
99
+ "Chinese"
100
+ CH
101
+ }
102
+ ```
103
+
104
+
41
105
## Schema
42
106
43
- SchemaDefinition : schema Directives[ Const] ? { RootOperationTypeDefinition+ }
107
+ SchemaDefinition : Description? schema Directives[ Const] ? { RootOperationTypeDefinition+ }
44
108
45
109
RootOperationTypeDefinition : OperationType : NamedType
46
110
@@ -169,63 +233,6 @@ Schema extensions have the potential to be invalid if incorrectly defined.
169
233
original Schema.
170
234
171
235
172
- ## Descriptions
173
-
174
- Description : StringValue
175
-
176
- Documentation is a first-class feature of GraphQL type systems. To ensure
177
- the documentation of a GraphQL service remains consistent with its capabilities,
178
- descriptions of GraphQL definitions are provided alongside their definitions and
179
- made available via introspection.
180
-
181
- To allow GraphQL service designers to easily publish documentation alongside the
182
- capabilities of a GraphQL service, GraphQL descriptions are defined using the
183
- Markdown syntax (as specified by [ CommonMark] ( https://commonmark.org/ ) ). In the
184
- type system definition language, these description strings (often {BlockString})
185
- occur immediately before the definition they describe.
186
-
187
- All GraphQL types, fields, arguments and other definitions which can be
188
- described should provide a {Description} unless they are considered self
189
- descriptive.
190
-
191
- As an example, this simple GraphQL schema is well described:
192
-
193
- ``` graphql example
194
- """
195
- A simple GraphQL schema which is well described.
196
- """
197
- type Query {
198
- """
199
- Translates a string from a given language into a different language.
200
- """
201
- translate (
202
- "The original language that `text` is provided in."
203
- fromLanguage : Language
204
-
205
- "The translated language to be returned."
206
- toLanguage : Language
207
-
208
- "The text to be translated."
209
- text : String
210
- ): String
211
- }
212
-
213
- """
214
- The set of languages supported by `translate`.
215
- """
216
- enum Language {
217
- "English"
218
- EN
219
-
220
- "French"
221
- FR
222
-
223
- "Chinese"
224
- CH
225
- }
226
- ```
227
-
228
-
229
236
## Types
230
237
231
238
TypeDefinition :
0 commit comments