Skip to Content
🚧 This is WIP documentation for v4 of the plugin. For v3 click here.
ESLGraphQL-ESLint
Rulesno-scalar-result-type-on-mutation

no-scalar-result-type-on-mutation

💡 This rule provides suggestions

  • 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!
}

Resources

Last updated on