Skip to content

require-id-when-available does not warn for nested fields within a fragment #964

@jordan-burnett

Description

@jordan-burnett

Describe the bug

When using require-id-when-available I do not receive a warning when I do not request an ID for a nested field within a fragment

To Reproduce

Schema:

type Book {
  id: String!
  name: String!
  author: Author!
}

type Author {
  id: String!
  name: String!
}

Document:

query GetBook {
    book {
       id
       name
        ...BookFragment
    }
}

fragment BookFragment on Book {
   author {
        name
    }
}

Expected behavior

I would expect to recieve a warning that I did not request Author.id in BookFragment

Environment:

  • OS: OSX
  • @graphql-eslint/3.8.0
  • NodeJS: 14.18.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugBug :-(kind/enhancementNew feature or requeststage/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