Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 1.01 KB

no-typename-prefix.md

File metadata and controls

39 lines (26 loc) · 1.01 KB

no-typename-prefix

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

💡 This rule provides suggestions

  • Category: Schema
  • Rule name: @graphql-eslint/no-typename-prefix
  • Requires GraphQL Schema: false ℹ️
  • Requires GraphQL Operations: false ℹ️

Enforces users to avoid using the type name in a field name while defining your schema.

Usage Examples

Incorrect

# eslint @graphql-eslint/no-typename-prefix: 'error'

type User {
  userId: ID!
}

Correct

# eslint @graphql-eslint/no-typename-prefix: 'error'

type User {
  id: ID!
}

Resources