- 
                Notifications
    You must be signed in to change notification settings 
- Fork 109
Closed
Labels
kind/bugBug :-(Bug :-(stage/6-releasedThe issue has been solved on a released version of the libraryThe issue has been solved on a released version of the library
Description
Issue workflow progress
Progress of the issue based on the Contributor Workflow
- 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox
Please make sure the graphql-eslint version under
package.jsonmatches yours.
- 2. A failing test has been provided
- 3. A local solution has been provided
- 4. A pull request is pending review
Describe the bug
Fragments are not validated against @graphql-eslint/require-id-when-available rule.
Schema
type Query {
  user(id: String!): UserResult
}
union UserResult = Account | Error
type Account {
  id: ID!
  name: String!
  phone: String
}
type Error {
  message: String!
}Query
query UserById($id: String!) {
  user(id: $id) {
    ... on Account {
      # inline fragment: we expect an error here about a missing `id` field
      ...UserFields
    }
    ... on Error {
      message
    }
  }
}
fragment UserFields on Account {
  # fragment: we expect an error here about a missing `id` field
  name
  phone
}To Reproduce
Steps to reproduce the behavior:
https://github.com/benatshippabo/graphql-eslint-bug
Expected behavior
We expect eslint to error on the inline Account fragment and the Account fragment.
Environment:
- OS: MacOS 12.4
- @graphql-eslint/eslint-plugin: ^3.10.6
- Node.js: v16.16.0
Additional context
mangano-ito and vicky-carbon
Metadata
Metadata
Assignees
Labels
kind/bugBug :-(Bug :-(stage/6-releasedThe issue has been solved on a released version of the libraryThe issue has been solved on a released version of the library