require-nullable-result-in-root
đĄ This rule provides suggestions (opens in a new tab)
- Category:
Schema
- Rule name:
@graphql-eslint/require-nullable-result-in-root
- Requires GraphQL Schema:
true
âšī¸ - Requires GraphQL Operations:
false
âšī¸
Require nullable fields in root types.
Usage Examples
Incorrect
# eslint @graphql-eslint/require-nullable-result-in-root: 'error'
type Query {
user: User!
}
Correct
# eslint @graphql-eslint/require-nullable-result-in-root: 'error'
type Query {
foo: User
baz: [User]!
bar: [User!]!
}