no-unused-fields
đĄ This rule provides suggestions (opens in a new tab)
- Category:
Schema
- Rule name:
@graphql-eslint/no-unused-fields
- Requires GraphQL Schema:
true
âšī¸ - Requires GraphQL Operations:
true
âšī¸
Requires all fields to be used at some level by siblings operations.
Usage Examples
Incorrect
# eslint @graphql-eslint/no-unused-fields: 'error'
type User {
id: ID!
name: String
someUnusedField: String
}
type Query {
me: User
}
query {
me {
id
name
}
}
Correct
# eslint @graphql-eslint/no-unused-fields: 'error'
type User {
id: ID!
name: String
}
type Query {
me: User
}
query {
me {
id
name
}
}