Skip to content

No-unreachable-types does not account for directive's parameters #301

@ilyavolodin

Description

@ilyavolodin

When an enum or type is used as a parameter in a directive no-unreachable-types reports that enum/type as unreachable. Repro case:

directive @omit(unlessContains: [String], unlessContainsTypes: OmitTypes) on FIELD_DEFINITION

"Types of 'unlessContainsTypes' omit"
enum OmitTypes {
  "Scalar fields"
  scalar
  "Complex type fields"
  nonScalar
}

OmitTypes will be marked as unreachable by the rule.

On a slightly different note, "unreachable" is very confusing term here. I would've called it "unused" instead. Types are always reachable, but can be unused.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugBug :-(stage/6-releasedThe issue has been solved on a released version of the library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions