resolve

abstract suspend fun resolve(resolveInfo: ResolveInfo): ResolverValue?

Resolves a field. A typical implementation uses ResolveInfo.parentObject:

fun resolve(resolveInfo: ResolveInfo): Any? {
val parent = resolveInfo.parentObject as Map<String, Any?>
return parent[resolveInfo.fieldName]
}

Return

the resolved result

Parameters

resolveInfo

information about the field being resolved

Throws

if something wrong happens. A GraphQL error for that field is generated.