You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I want to leverage abstract classes to define interfaces corresponding to schema types, and have separate resolver classes inherit from those abstract classes. This provides a type contract that I can enforce separately from my resolvers.
I would include the abstract class MyType in scope for SDL generation, and I would exclude MyTypeResolver from SDL generation, such that the abstract class explicitly defines the resulting SDL. As a result, my Kotlin that corresponds to SDL can be decoupled from my implementation.
However, when I attempt to do this, I get the following error at runtime from graphql-java when executing a query: Abstract type "MyType" must resolve to an Object type at runtime for field "MyType.myfield". Could not determine the exact type of "MyType"
Describe the solution you'd like
I would like it to be possible to define schema-specific interfaces in Kotlin in a way that is decoupled from my implementation. If the blocker here exists within graphql-java, I wonder if there is a way that graphql-kotlin can help us work around it. Maybe we can add support for a particular directive? 🤷
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I want to leverage abstract classes to define interfaces corresponding to schema types, and have separate resolver classes inherit from those abstract classes. This provides a type contract that I can enforce separately from my resolvers.
For example, if my desired schema is:
Currently I need to couple my Kotlin schema classes with my implementation, like so:
But I instead want to leverage an abstract Kotlin class that corresponds to the schema:
I would include the abstract class
MyType
in scope for SDL generation, and I would excludeMyTypeResolver
from SDL generation, such that the abstract class explicitly defines the resulting SDL. As a result, my Kotlin that corresponds to SDL can be decoupled from my implementation.However, when I attempt to do this, I get the following error at runtime from graphql-java when executing a query:
Abstract type "MyType" must resolve to an Object type at runtime for field "MyType.myfield". Could not determine the exact type of "MyType"
Describe the solution you'd like
I would like it to be possible to define schema-specific interfaces in Kotlin in a way that is decoupled from my implementation. If the blocker here exists within graphql-java, I wonder if there is a way that graphql-kotlin can help us work around it. Maybe we can add support for a particular directive? 🤷
The text was updated successfully, but these errors were encountered: