You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please make sure the graphql-eslint version under package.json matches 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
Sometimes require-id-when-available issues are flagged on line 0:0, and when this happens the error cannot be ignored (neither eslint-disable-next-line nor eslint-disable work).
lint: /path/to/file/1
lint: 0:0 error Field `intensityTimeseries.id` must be selected when it's available on a type.
lint: Include it in your selection set or add to used fragments `TrajectoryFields` or `SimpleTimeseriesFields` @graphql-eslint/require-id-when-available
To Reproduce Steps to reproduce the behavior:
I'm not totally sure when it happens, but I believe it may be when there's a fragment used which is defined in another file and itself uses a fragment violating the rule.
/path/to/file/1
query {
field {
...Fields
}
}
/path/to/file/2
fragment SimpleTimeseriesFields {
# no id
name
value
}
fragment Fields on Field {
id
intensityTimeseries {
...SimpleTimeseriesFields
}
}
Expected behavior
The error should appear on the line using the offending fragment, rather than on line "0". And as such, it should be ignorable.
Environment:
OS: MacOS
@graphql-eslint/eslint-plugin: 3.19.1
Node.js: 18.15.3
Additional context
Would love any pointers to the potential cause, and any workarounds! Currently, the workaround is excluding the files in the eslint config.
The text was updated successfully, but these errors were encountered:
danielchiu
changed the title
require-id-when-available
errors for require-id-when-available with nested fragments occurring in wrong place
Sep 12, 2023
Issue workflow progress
Progress of the issue based on the
Contributor Workflow
1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox
2. A failing test has been provided
3. A local solution has been provided
4. A pull request is pending review
Describe the bug
Sometimes
require-id-when-available
issues are flagged on line0:0
, and when this happens the error cannot be ignored (neithereslint-disable-next-line
noreslint-disable
work).To Reproduce Steps to reproduce the behavior:
I'm not totally sure when it happens, but I believe it may be when there's a fragment used which is defined in another file and itself uses a fragment violating the rule.
/path/to/file/1
/path/to/file/2
Expected behavior
The error should appear on the line using the offending fragment, rather than on line "0". And as such, it should be ignorable.
Environment:
@graphql-eslint/eslint-plugin
: 3.19.1Additional context
Would love any pointers to the potential cause, and any workarounds! Currently, the workaround is excluding the files in the eslint config.
The text was updated successfully, but these errors were encountered: