JetBrains / js-graphql-intellij-plugin

GraphQL language support for WebStorm, IntelliJ IDEA and other IDEs based on the IntelliJ Platform.
https://jimkyndemeyer.github.io/js-graphql-intellij-plugin/
MIT License
880 stars 97 forks source link

[v2] Newly introduced index doesn't discover the fragments #235

Closed koresar closed 5 years ago

koresar commented 5 years ago

Version and Environment Details

Operation system: MacOS

IDE name and version: WebStorm 2019.1 Build #WS-191.6183.63, built on March 21, 2019 JRE: 1.8.0_202-release-1483-b39 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o macOS 10.14.4

Plugin version: 2.0

Expected Behaviour

Fragments are recognised.

Actual Behaviour

See red fragments

image

Steps to Reproduce / Link to Repo with Reproduction and Instructions

As recommended by @jimkyndemeyer I'm using the language=GraphQL WebStorm syntax highlight feature via a JS comment. See picture above.

Before releasing the stable v2 it was working just fine with v2-beta.

There is the trend to avoid any client-side (browser) libraries to do GraphPL POST requests.

Our requests look like this:

        const { login } = await store.dispatch(
            "graphql/mutation",
            // language=GraphQL
            {
                query: `mutation login($email:String! $pwd:String!) { login(email:$email pwd:$pwd) { success message } }`,
                variables: { email, pwd }
            }
        );

Where dispatch is Redux/Vuex action dispatching.

jimkyndemeyer commented 5 years ago

Hi Vasyl.

Thanks for the detailed description and your help in testing the 2.0 release.

This is definitely a valid use case that should be supported, and unfortunately I missed it when I introduced the fragments index.

I'll get this fixed for the first bugfix release.

As a temporary workaround you can manually install the plugin from disk using the latest beta release at https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/blob/v2/alpha-releases/JS%20GraphQL-2.0.0-beta-2.zip

Best regards, Jim.

jimkyndemeyer commented 5 years ago

Fixed for the upcoming 2.0.1 release.