noUnusedFragments
| Property | Value |
|---|---|
| Config name | noUnusedFragments |
| Default severity | warn |
| Context | Project |
| In recommended | Yes |
What it checks
Section titled “What it checks”Detects fragment definitions that are never spread in any operation or other fragment across the project. Dead fragments add noise and confusion.
Examples
Section titled “Examples”# ⚠️ Warning: Fragment 'OldUserFields' is never usedfragment OldUserFields on User { id name}
# This fragment is usedfragment UserFields on User { id email}
query GetUser { user { ...UserFields }}Configuration
Section titled “Configuration”extensions: graphql-analyzer: lint: rules: noUnusedFragments: warn # or error, off