Skip to content

noUnusedFields

Property Value
Config name noUnusedFields
Default severity warn
Context Project
In recommended Yes

Detects schema fields that are never queried in any operation or fragment across the project. Helps identify unused API surface area.

# Schema
type User {
id: ID!
email: String! # ⚠️ Warning: Field 'email' is never used
}
# Operations only query 'id', never 'email'
query {
user {
id
}
}
extensions:
graphql-analyzer:
lint:
rules:
noUnusedFields: warn # or error, off

This is a project-wide rule that analyzes all documents. It can be slow on large projects. If you experience latency in the editor, disable it in config and enable it in CI via CLI flags:

Terminal window
graphql check --rule noUnusedFields=error