GraphQL\Executor\Executor::doesFragmentConditionMatch PHP Method

doesFragmentConditionMatch() private static method

Determines if a fragment is applicable to the given type.
private static doesFragmentConditionMatch ( ExecutionContext $exeContext, $fragment, ObjectType $type ) : boolean
$exeContext ExecutionContext
$fragment
$type GraphQL\Type\Definition\ObjectType
return boolean
    private static function doesFragmentConditionMatch(ExecutionContext $exeContext, $fragment, ObjectType $type)
    {
        $typeConditionNode = $fragment->typeCondition;
        if (!$typeConditionNode) {
            return true;
        }
        $conditionalType = Utils\TypeInfo::typeFromAST($exeContext->schema, $typeConditionNode);
        if ($conditionalType === $type) {
            return true;
        }
        if ($conditionalType instanceof AbstractType) {
            return $exeContext->schema->isPossibleType($conditionalType, $type);
        }
        return false;
    }