Skip to content

Fragments are not properly detected for the known-fragment-names rule #472

@jgoux

Description

@jgoux

Hello all 👋,

Following the discussion here : #456 (comment)

Describe the bug

The rules known-fragment-names and no-unused-fragments are erroring even if all my fragments are loaded by graphql-eslint.

I edited the sources and logged the value of the siblings variable : https://github.com/dotansimha/graphql-eslint/blob/master/packages/plugin/src/sibling-operations.ts#L83-L88

When I run eslint CLI, here is the output : https://gist.github.com/jgoux/73b79e57b96531f89ab6c99b089c2512
You can see the errors at the end : https://gist.github.com/jgoux/73b79e57b96531f89ab6c99b089c2512#file-log-sh-L796-L818
As an example, the ProfileForm_user fragment which is in error is properly detected and loaded here : https://gist.github.com/jgoux/73b79e57b96531f89ab6c99b089c2512#file-log-sh-L98-L105

To Reproduce
Steps to reproduce the behavior:

Expected behavior

If all the fragments are detected by the plugin, I should have no errors in my case.

Environment:

  • OS: MacOS Big Sur
  • @graphql-eslint/...: 1.0.1
  • NodeJS: v14.15.5

Additional context

Metadata

Metadata

Assignees

Labels

stage/5-alpha-release-testingThe pull request is merged, an alpha release is available, to be tested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions