resolveType

abstract fun resolveType(obj: ResolverValue?, resolveTypeInfo: ResolveTypeInfo): String

Returns the GraphQL object typename of the given Kotlin instance.

This is used for polymorphic types to return the correct __typename depending on the runtime type of obj.

Example:

when (it) {
is Product -> "Product"
}

Throws

if obj cannot be resolved. A GraphQL error is raised for that field.