lighthouse
lighthouse copied to clipboard
Usage of relationship directives with pagination on interfaces fails
Describe the bug
I tried to create a BaseUser interface, which in this example has many permissions, this causes an error to happen. I believe the schema may get generated incorrectly.
Expected behavior/Solution
Schema should generate correctly?
Steps to reproduce
interface Test {
relationship: [Relationship!] @belongsToMany(type: CONNECTION)
}
type TestConcrete implements Test {
relationship: [Relationship!] @belongsToMany(type: CONNECTION)
}
type Relationship {
id: ID
}
Use this as your schema and you'll get an error
Output/Logs
Click to expand
{
"error": "Invalid schema Error:\nInterface field Test.relationship expects type [Relationship!] but TestConcrete.relationship is type RelationshipConnection.\nObject field TestConcrete.relationship includes required argument first that is missing from the Interface field Test.relationship."
}
Lighthouse Version
Latest
@olivernybroe this is the same problem you had, right?
@spawnia exactly 👍
I was just too lazy to create a task for it 😅
I have attempted to solve this previously here, but with little success. https://github.com/nuwave/lighthouse/pull/2012 Working with php8 only, would be a breeze though.