-
Couldn't load subscription status.
- Fork 174
Open
Labels
Description
Description
Consider the following dataclass hierarchy:
abstract class Base { } class Thing extends Base { }This is a custom resolver for the abstract class Base:
class BaseResolver implements GraphQLResolver<Base> { public boolean isActive(Base base) { return true; } }Root query resolver with datafetcher that returns our concrete class Thing:
class RootQueryResolver implements GraphQLQueryResolver { public Thing getThing() { return new Thing(); } }Expected behavior
The following schema should work fine and return true for queries on the active field:
type Query { thing: Thing! } type Thing { active: Boolean! }Actual behavior
graphql.kickstart.tools.resolver.FieldResolverError: No method or field found as defined in schema [...] Steps to reproduce the bug
- Create a resolver for a supertype (class or interface) with any datafetcher
- Have a query return a subclass of that type
- Try building the schema
AlexiosP