src/Type/SchemaValidationContext.php
private function getUnionMemberTypeNodes(UnionType $union, $typeName)
    {
        if ($union->astNode && $union->astNode->types) {
            return array_filter(
                $union->astNode->types,
                static function (NamedTypeNode $value) use ($typeName) {
                    return $value->name->value === $typeName;
                }
            );
        }

        return $union->astNode ?
            $union->astNode->types : null;
    }
private function getUnionMemberTypeNodes(UnionType $union, $typeName)
    {
        if ($union->astNode && $union->astNode->types) {
            return array_filter(
                $union->astNode->types,
                static function (NamedTypeNode $value) use ($typeName) {
                    return $value->name->value === $typeName;
                }
            );
        }

        return $union->astNode ?
            $union->astNode->types : null;
    }
@param string $typeName

@return NamedTypeNode[]