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
When using the require-selections rule with the requireAllFields option, a selection on a type that has any of the fieldNames is demanded to include all of the fieldNames, whether or not they exist on that type.
To Reproduce Steps to reproduce the behavior:
I've included a unit test in my PR #2912 that reproduces the error: dfdda86
The issue occurs when requireAllFields is set true and a given type implements only some of the specified fieldNames. e.g. given a schema
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
When using the
require-selections
rule with therequireAllFields
option, a selection on a type that has any of thefieldNames
is demanded to include all of thefieldNames
, whether or not they exist on that type.To Reproduce Steps to reproduce the behavior:
I've included a unit test in my PR #2912 that reproduces the error: dfdda86
The issue occurs when
requireAllFields
is settrue
and a given type implements only some of the specifiedfieldNames
. e.g. given a schemaa rule config
and a document
the rule will report that you must select the
user.title
anduser.content
fields, even though they don't exist.Expected behavior
The lint rule should not fail selection sets based on the absence of fields that cannot be selected in that context.
Environment:
@graphql-eslint/eslint-plugin
: 4.4.0The text was updated successfully, but these errors were encountered: