Youshido\GraphQL\Execution\Processor::resolveComposite PHP Méthode

resolveComposite() protected méthode

protected resolveComposite ( Youshido\GraphQL\Field\FieldInterface $field, Youshido\GraphQL\Parser\Ast\Interfaces\FieldInterface $ast, $parentValue )
$field Youshido\GraphQL\Field\FieldInterface
$ast Youshido\GraphQL\Parser\Ast\Interfaces\FieldInterface
    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);
    }