def METHOD_NAME(self, union: StrawberryUnion) -> str:
    if union.graphql_name is not None:
        return union.graphql_name
    name = ""
    for type_ in union.types:
        if isinstance(type_, LazyType):
            type_ = cast("StrawberryType", type_.resolve_type())  # noqa: PLW2901
        if has_object_definition(type_):
            type_name = self.from_type(type_.__strawberry_definition__)
        else:
            # This should only be hit when generating names for type-related
            # exceptions
            type_name = self.from_type(type_)
        name += type_name
    return name