ResolveType

typealias ResolveType = (obj: Any, resolveTypeInfo: ResolveTypeInfo) -> String?

Returns the typename of the given obj

This is used for polymorphic types to return the correct __typename depending on the runtime type of obj. This function must return a non-null String for any Kotlin instance that represents a GraphQL type that implements an interface or is part of a union.

Example:

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

Returns the name of the GraphQL type for this runtime instance or null if this runtime instance is not found, which will trigger a GraphQL error.