unreachable-types
Since 0.9.0 · In the rulesets: Strict at error, All at error
This rule checks that every type is reachable from the root operation types.
Rule details
A type that no field, argument or union reaches is dead code: clients cannot use it. Types are reached through the fields, arguments, input fields, union members and interfaces of reached types, the implementations of reached interfaces, and the arguments of directive definitions. Documents without root operation types are not checked.
Turn the rule off when the schema is split across files.
The rule applies to definitions. An # apigenie-lint-disable unreachable-types comment on a node
turns it off for the node and everything nested in it; at the top of the file, separated from the
first definition by a blank line, the comment turns it off for the whole file.
Examples
Good.
type Query { user: User }
type User { id: ID! }
Bad. The linter reports Object type 'Orphan' is not reachable from the root operation types.
type Query { user: User }
type User { id: ID! }
type Orphan { id: ID! }
Turn it off or change its severity
In apigenie.yaml, off turns the rule off and warning or error sets its severity; a rule with options takes the severity and the options as a pair, [warning, options]. lint.graphql has the details.
commands:
lint:
graphql:
rules:
unreachable-types: off