At a glance
- Identifier: #1170
- Stage: RFC 3 / Accepted
- Champion: @fotoetienne
- Latest activity: 3 commits pushed on 2025-07-01
- Spec PR: https://github.com/graphql/graphql-spec/pull/1170
- Related:
Spec PR description
This PR builds upon @IvanGoncharov's 2021 RFC, with changes rebased onto the current spec and updated to incorporate feedback from previous discussion as well as an additional editorial pass.
Descriptions are a core feature of GraphQL, enabling schema and document authors to provide human-readable documentation directly alongside type system elements and executable definitions. This proposal extends the utility of descriptions by allowing them to appear not only on type system definitions, but also on operations, fragments, and variable definitions within executable documents.
Enabling descriptions in these locations improves the expressiveness and maintainability of GraphQL documents, supports better tooling and code generation, and enhances the developer experience by making intent and usage clearer at the point of definition. Importantly, descriptions remain non-semantic—they do not affect execution, validation, or response—ensuring that they serve purely as documentation and can be safely removed without impacting behavior. This change aligns with GraphQL’s commitment to self-documenting APIs and empowers teams to deliver more understandable and maintainable GraphQL applications.
Key points:
- You can add descriptions on operations, fragments, and query variables
- You can't add description on the the shorthand form of operations, only the full form
- Descriptions on operations do not affect query execution, validation, or response
Example:
"""
Request the current status of a time machine and its operator.
"""
query GetTimeMachineStatus(
"The unique serial number of the time machine to inspect."
$machineId: ID!
"""
The year to check the status for.
**Warning:** certain years may trigger an anomaly in the space-time continuum.
"""
$year: Int
) {
timeMachine(id: $machineId) {
...TimeMachineDetails
operator {
name
licenseLevel
}
status(year: $year)
}
}
"Time machine details."
fragment TimeMachineDetails on TimeMachine {
id
model
lastMaintenance
}
Implemented in Graphql.js by https://github.com/graphql/graphql-js/pull/4430
Timeline
- 3 commits pushed on 2025-07-01:
- leebyron committed "Editorial: move descriptions definition above document"
- leebyron committed "editorial: move examples back to type system, add some links"
- leebyron committed "Editorial"
- 2 commits pushed on 2025-06-28:
- fotoetienne committed "Refactor descriptions text, incorporating feedback from working group"
- fotoetienne committed "formatting"
- Added to WG agenda on 2025-06-26
- Commit pushed on 2025-06-12 by fotoetienne: Single quotes for single line description
- 5 commits pushed on 2025-06-11:
- fotoetienne committed "Refactor description section for clarity"
- fotoetienne committed "Add optional description to fragment and variable definitions"
- fotoetienne committed "Prettier"
- fotoetienne committed "Refactor time machine status query documentation for clarity and conc…"
- fotoetienne committed "Reduced example"
- Spec PR created on 2025-06-05 by fotoetienne
- 2 commits pushed on 2025-06-05:
- fotoetienne committed "Updated spec wording for descriptions in executable documents"
- fotoetienne committed "Add example label to GraphQL code block in Language section"
- Commit pushed on 2021-10-07 by IvanGoncharov: Add descriptions to executable definitions