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
879 stars 97 forks source link

Introspection stopped working #535

Closed simPod closed 2 years ago

simPod commented 2 years ago

Describe the bug

Running introspection does nothing. It does not seem to issue any request nor gives any error

image

To Reproduce

Introspected a:

{
    "projects": {
        "a": {
            "schemaPath": "a.graphqls",
            "extensions": {
                "endpoints": {
                    "env": {
                        "url": "https://endpoint.com/graphql",
                        "headers": {
                            "user-agent": "JS GraphQL"
                        }
                    }
                }
            }
        }
    }
}

Version and Environment Details Operation system: [version] IDE name and version: 2021.3 IDEA Plugin version: 3.1.0

vepanimas commented 2 years ago

Hi! Are there any errors containing the "GraphQL" string in the log Help -> Open log in ...?

You can also try to run it from the configuration file using this green button:

introspection
simPod commented 2 years ago

I tried also the green button but the result was the same. Will try to check the logs tmrw, thank you for reply.

vepanimas commented 2 years ago

I'll look through the code to check it again.

Also, please, try to remove the schema file explicitly and introspect it again. Now it's possible that the newly introspected schema in not opened in the editor, but an introspection was successful. To open the editor should be a default behavior, but something could go wrong. It's configured by this new option: open editor

vepanimas commented 2 years ago

Can be related #520. Workaround if NullPointerException is present https://github.com/jimkyndemeyer/js-graphql-intellij-plugin/issues/520#issuecomment-989048076.

simPod commented 2 years ago

Yup, I have that checked.

Clicking on green arrow does not produce any exception.


There was this inspection when IDE started


java.lang.NullPointerException
    at com.intellij.lang.jsgraphql.ide.introspection.GraphQLIntrospectionService.getSecurityConfig(GraphQLIntrospectionService.java:198)
    at com.intellij.lang.jsgraphql.ide.introspection.GraphQLIntrospectionService$IntrospectionQueryTask.run(GraphQLIntrospectionService.java:537)
    at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:436)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:120)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:496)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:244)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:624)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:646)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:623)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:244)
    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
    at java.base/java.lang.Thread.run(Thread.java:829)```
vepanimas commented 2 years ago

Should be fixed in 3.1.2.

simPod commented 2 years ago

Confirmed, it works. Thanks!

Stevemoretz commented 1 year ago

I'll look through the code to check it again.

Also, please, try to remove the schema file explicitly and introspect it again. Now it's possible that the newly introspected schema in not opened in the editor, but an introspection was successful. To open the editor should be a default behavior, but something could go wrong. It's configured by this new option: open editor

This is really helpful, specially if you use a keyboard shortcut I was desperately looking for this