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

Cannot run introspection when schema has types implementing multiple interfaces #567

Closed simPod closed 2 years ago

simPod commented 2 years ago

Describe the bug

The schema should be valid but gives following error:

The object type 'FooEdge' has tried to redefine field 'node' defined via interface 'Edge' from 'Node!' to 'Incident!'

SchemaProblem{errors=[The object type 'FooEdge' has tried to redefine field 'node' defined via interface 'Edge' from 'Node!' to 'Foo!']}
    at com.intellij.lang.jsgraphql.ide.editor.GraphQLIntrospectionService.printIntrospectionAsGraphQL(GraphQLIntrospectionService.java:275)
    at com.intellij.lang.jsgraphql.ide.editor.GraphQLIntrospectionService$IntrospectionQueryTask.run(GraphQLIntrospectionService.java:497)
    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)

To Reproduce

interface Connection {
    edges: [Edge!]!
}
interface Edge {
    node: Node!
}
interface Node {
    id: ID!
}
type FooConnection implements Connection {
    edges: [IncidentEdge!]!
}
type FooEdge implements Edge {
    node: Incident!
}

Expected behavior

The schema should be valid

Screenshots If applicable, add screenshots to help explain your problem.

Version and Environment Details Operation system: macos IDE name and version: IDEA 2021.3 Plugin version: 3.1.1

Additional context Add any other context about the problem here.

simPod commented 2 years ago

It allows to run introspection since 3.1.2.