aPureBase / KGraphQL

Pure Kotlin GraphQL implementation
https://kgraphql.io
MIT License
298 stars 58 forks source link

Ability to implement an interface into another interface #132

Open berserkore opened 3 years ago

berserkore commented 3 years ago

Thanks for this great library, GraphQL spec has now support for implementing an interface into another interface. Looks like KGraphQL already support this feature, I was able to successfully retrieve the child interface using the spread operator. However, the introspection schema does not show the implementation within the interface and highlight it as an error.

Take the following example:

interface A {
   val prop1: String
 }
 interface B: A {
    override val prop1: String
    val prop2: String
 }

Implements does not show because schema does not explicitly tell it and result to the following introspection:

Screen Shot 2021-02-18 at 1 28 46 am

However it works with a "data class":

interface A {
   val prop1: String
}
data class B (
    override val prop1: String,
    val prop2: String
): A
Screen Shot 2021-02-18 at 1 31 03 am

Here is another reference: https://github.com/graphql/graphql-spec/pull/373