no-scalar-result-type-on-mutation
đĄ This rule provides suggestions (opens in a new tab)
- Category:
Schema
- Rule name:
@graphql-eslint/no-scalar-result-type-on-mutation
- Requires GraphQL Schema:
true
âšī¸ - Requires GraphQL Operations:
false
âšī¸
Avoid scalar result type on mutation type to make sure to return a valid state.
Usage Examples
Incorrect
# eslint @graphql-eslint/no-scalar-result-type-on-mutation: 'error'
type Mutation {
createUser: Boolean
}
Correct
# eslint @graphql-eslint/no-scalar-result-type-on-mutation: 'error'
type Mutation {
createUser: User!
}