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
When a query imports a fragment (using #import) that itself also imports another fragment, all documents are reported as to having a duplicate fragment names.
[I can spin this out in a seperate issue if you'd like] The @graphql-eslint/no-unused-fragments also doesn't handle this situation of nested imports correctly:
I would have expected fragments to be considered used if they were imported by imports of intermediate fragments.
Describe the bug
When a query imports a fragment (using
#import
) that itself also imports another fragment, all documents are reported as to having a duplicate fragment names.To Reproduce
Check out this gist: https://gist.github.com/lennartbuit/3d0141b62432c133ca553de15792ad17
In this setup, I have a query importing fragment A that itself imports fragment B.
Running
yarn eslint *.graphql
will flag all files as having violations of the unique-fragment-name rule:Expected behavior
No reported errors. Fragments are only defined once, after all.
Environment:
@graphql-eslint/...
: 1.1.0Additional context
The text was updated successfully, but these errors were encountered: