graphql / graphql/graphql-spec
Make the unadorned type non-null?
- Dominant language
- JavaScript
- Stars
- 14.6k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
_Edited in March 2025 to explicitly mention the unadorned type_
This is a follow up from #63.
GraphQL best practices are currently to [use nullable types by default](https://graphql.org/learn/best-practices/#nullability).
This is reflected in the syntax by the fact that `String` is a nullable type. That is in contrast with languages like `Swift` and `Kotlin` where `String` is non-nullable and the nullable type has a `?` modifier: `String?`.
With all the work going on in the [nullability working group](https://github.com/graphql/nullability-wg) and the advent of [semantic non null](https://github.com/captbaritone/awesome-semantic-nullability) types, feels like now is a good time to revisit. Should the unadorned type be non-null?
This issue is for gathering community feedback and use cases. Would you rather keep the current unadorned type nullable by default? Or change it to non null by default?
Contributor guide
Assessment
This issue has not been assessed yet.