Skip to content

Commit 14cce61

Browse files
committed
Add descriptions to executable definitions
1 parent ffb1fcc commit 14cce61

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

spec/Appendix B -- Grammar Summary.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ ExecutableDefinition :
127127
- OperationDefinition
128128
- FragmentDefinition
129129

130+
Description : StringValue
131+
130132
OperationDefinition :
131-
- OperationType Name? VariableDefinitions? Directives? SelectionSet
133+
- Description? OperationType Name? VariableDefinitions? Directives? SelectionSet
132134
- SelectionSet
133135

134136
OperationType : one of `query` `mutation` `subscription`
@@ -152,7 +154,7 @@ FragmentSpread : ... FragmentName Directives?
152154

153155
InlineFragment : ... TypeCondition? Directives? SelectionSet
154156

155-
FragmentDefinition : fragment FragmentName TypeCondition Directives? SelectionSet
157+
FragmentDefinition : Description? fragment FragmentName TypeCondition Directives? SelectionSet
156158

157159
FragmentName : Name but not `on`
158160

@@ -187,7 +189,7 @@ ObjectField[Const] : Name : Value[?Const]
187189

188190
VariableDefinitions : ( VariableDefinition+ )
189191

190-
VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
192+
VariableDefinition : Description? Variable : Type DefaultValue? Directives[Const]?
191193

192194
Variable : $ Name
193195

@@ -235,8 +237,6 @@ SchemaExtension :
235237

236238
RootOperationTypeDefinition : OperationType : NamedType
237239

238-
Description : StringValue
239-
240240
TypeDefinition :
241241
- ScalarTypeDefinition
242242
- ObjectTypeDefinition

spec/Section 2 -- Language.md

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

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

278290
## Operations
279291

0 commit comments

Comments
 (0)