🎉 Welcome to the new GraphQL-ESLint website. Try new playground page →
Rules
No Unreachable Types

no-unreachable-types

✅ The "extends": "plugin:@graphql-eslint/schema-recommended" property in a configuration file enables this rule.

💡 This rule provides suggestions (opens in a new tab)

  • Category: Schema
  • Rule name: @graphql-eslint/no-unreachable-types
  • Requires GraphQL Schema: true ℹī¸
  • Requires GraphQL Operations: false ℹī¸

Requires all types to be reachable at some level by root level fields.

Usage Examples

Incorrect

# eslint @graphql-eslint/no-unreachable-types: 'error'
 
type User {
  id: ID!
  name: String
}
 
type Query {
  me: String
}

Correct

# eslint @graphql-eslint/no-unreachable-types: 'error'
 
type User {
  id: ID!
  name: String
}
 
type Query {
  me: User
}

Resources