Skip to content

Commit 5517373

Browse files
IvanGoncharovfotoetienne
authored andcommitted
Add descriptions to executable definitions
1 parent a44d4ec commit 5517373

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

spec/Appendix B -- Grammar Summary.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,11 @@ ExecutableDefinition :
147147
- OperationDefinition
148148
- FragmentDefinition
149149

150+
Description : StringValue
151+
150152
OperationDefinition :
151153

152-
- OperationType Name? VariablesDefinition? Directives? SelectionSet
154+
- Description? OperationType Name? VariablesDefinition? Directives? SelectionSet
153155
- SelectionSet
154156

155157
OperationType : one of `query` `mutation` `subscription`
@@ -174,7 +176,7 @@ FragmentSpread : ... FragmentName Directives?
174176

175177
InlineFragment : ... TypeCondition? Directives? SelectionSet
176178

177-
FragmentDefinition : fragment FragmentName TypeCondition Directives?
179+
FragmentDefinition : Description? fragment FragmentName TypeCondition Directives?
178180
SelectionSet
179181

180182
FragmentName : Name but not `on`
@@ -213,7 +215,7 @@ ObjectField[Const] : Name : Value[?Const]
213215

214216
VariablesDefinition : ( VariableDefinition+ )
215217

216-
VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
218+
VariableDefinition : Description? Variable : Type DefaultValue? Directives[Const]?
217219

218220
Variable : $ Name
219221

@@ -268,8 +270,6 @@ SchemaExtension :
268270

269271
RootOperationTypeDefinition : OperationType : NamedType
270272

271-
Description : StringValue
272-
273273
TypeDefinition :
274274

275275
- ScalarTypeDefinition

spec/Section 2 -- Language.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,19 @@ operations, each operation must be named. When submitting a Document with
275275
multiple operations to a GraphQL service, the name of the desired operation to
276276
be executed must also be provided.
277277

278+
## Descriptions
279+
280+
Description : StringValue
281+
282+
Documentation is a first-class feature of GraphQL.
283+
GraphQL descriptions are defined using the Markdown syntax (as specified by
284+
[CommonMark](https://commonmark.org/)). Description strings (often {BlockString})
285+
occur immediately before the definition they describe.
286+
287+
GraphQL definitions (e.g. queries, fragments, types, fields, arguments, etc.)
288+
which can be described should provide a {Description} unless they are considered
289+
self descriptive.
290+
278291
## Operations
279292

280293
OperationDefinition :

0 commit comments

Comments
 (0)