js-graphql-intellij-plugin
js-graphql-intellij-plugin copied to clipboard
False positive schema inspection error for inspection 'Interface implementation'
Describe the bug The schema inspection "Interface implementation" is to strict.
False positive error with message:
The object type 'AorBEdge' has tried to redefine field 'node' defined via interface 'Edge' from 'Node!' to 'StricterNode!'
The redifinition of the 'node' fields return type should be allowed, because the new return type 'StricterNode' implements the 'Node' interface (just a refinement).
The inspection seems to raise an error if any redefinition of a field defined by an interface is attempted. Instead it should check, whether or not the new type is a refinement of the original return type.
To Reproduce
interface Node {
id: ID!
}
interface Edge {
cursor: String!
node: Node!
}
interface StricterNode implements Node {
id: ID!
}
type A implements StricterNode & Node {
id: ID!
}
type B implements StricterNode & Node {
id: ID!
}
type AorBEdge implements Edge { # <-- False positive appears here, see screenshot.
cursor: String!
node: StricterNode!
}
Expected behavior
This is valid GraphQL-SDL, so there is no error to detect.
Validity of SDL was ensured by executing this schema with pythons ariadne
library, which results in no error.
Screenshots
Version and Environment Details Operation system: [Windows10] IDE name and version: [pyCharm 2021.3] Plugin version: [3.1.1]