Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive schema inspection error for inspection 'Interface implementation' #563

Closed
j-riebe opened this issue Dec 9, 2021 · 0 comments

Comments

@j-riebe
Copy link

j-riebe commented Dec 9, 2021

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
grafik

Version and Environment Details
Operation system: [Windows10]
IDE name and version: [pyCharm 2021.3]
Plugin version: [3.1.1]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants