js-graphql-intellij-plugin icon indicating copy to clipboard operation
js-graphql-intellij-plugin copied to clipboard

Find variable usages in the referenced fragments

Open dwesty17 opened this issue 2 years ago • 1 comments

Describe the bug

When a fragment isn't colocated with the query that uses it any variables used by the query are reported as unused in the parent query.

To Reproduce See screenshots below.

Expected behavior Error shouldn't be reported as variable is being used by fragment.

Screenshots

Screen Shot 2021-12-08 at 11 06 13 PM Screen Shot 2021-12-08 at 11 06 25 PM

Version and Environment Details Operation system: MacOS Monterey IDE name and version: PhpStorm 2021.2.3 Plugin version: 3.0.0

dwesty17 avatar Dec 09 '21 04:12 dwesty17

The same issue is for queries inside JS/TS files:

image

The fragment is exported from separate file:

image

I don't know is it difficult to deal with language-specific imports/exports, but some other tools like graphql-code-generator respects this syntax.

yura3d avatar Jun 05 '22 11:06 yura3d