Skip to content

Add descriptions to executable definitions #892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions spec/Appendix B -- Grammar Summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ ExecutableDefinition :
- OperationDefinition
- FragmentDefinition

Description : StringValue

OperationDefinition :
- OperationType Name? VariableDefinitions? Directives? SelectionSet
- Description? OperationType Name? VariableDefinitions? Directives? SelectionSet
- SelectionSet

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

InlineFragment : ... TypeCondition? Directives? SelectionSet

FragmentDefinition : fragment FragmentName TypeCondition Directives? SelectionSet
FragmentDefinition : Description? fragment FragmentName TypeCondition Directives? SelectionSet

FragmentName : Name but not `on`

Expand Down Expand Up @@ -187,7 +189,7 @@ ObjectField[Const] : Name : Value[?Const]

VariableDefinitions : ( VariableDefinition+ )

VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
VariableDefinition : Description? Variable : Type DefaultValue? Directives[Const]?

Variable : $ Name

Expand Down Expand Up @@ -235,8 +237,6 @@ SchemaExtension :

RootOperationTypeDefinition : OperationType : NamedType

Description : StringValue

TypeDefinition :
- ScalarTypeDefinition
- ObjectTypeDefinition
Expand Down
12 changes: 12 additions & 0 deletions spec/Section 2 -- Language.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,18 @@ operations, each operation must be named. When submitting a Document with
multiple operations to a GraphQL service, the name of the desired operation to
be executed must also be provided.

## Descriptions

Description : StringValue

Documentation is a first-class feature of GraphQL.
GraphQL descriptions are defined using the Markdown syntax (as specified by
[CommonMark](https://commonmark.org/)). Description strings (often {BlockString})
occur immediately before the definition they describe.

GraphQL definitions (e.g. queries, fragments, types, fields, arguments, etc.)
which can be described should provide a {Description} unless they are considered
self descriptive.

## Operations

Expand Down