🎉 Welcome to the new GraphQL-ESLint website. Try new playground page →
Rules
No Scalar Result Type on Mutation

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

Resources