protected function resolveComposite(FieldInterface $field, AstFieldInterface $ast, $parentValue)
{
/** @var AstQuery $ast */
$resolvedValue = $this->doResolve($field, $ast, $parentValue);
$this->resolveValidator->assertValidResolvedValueForField($field, $resolvedValue);
/** @var AbstractUnionType $type */
$type = $field->getType()->getNullableType();
$resolvedType = $type->resolveType($resolvedValue);
if (!$resolvedType) {
throw new ResolveException('Resoling function must return type');
}
if ($type instanceof AbstractInterfaceType) {
$this->resolveValidator->assertTypeImplementsInterface($resolvedType, $type);
} else {
$this->resolveValidator->assertTypeInUnionTypes($resolvedType, $type);
}
$fakeField = new Field(['name' => $field->getName(), 'type' => $resolvedType]);
return $this->resolveObject($fakeField, $ast, $resolvedValue, true);
}