3 ms·
> Also, using a `oneof` field is correctly typed on the frontend as myfield: TypeA | TypeB | TypeC But what about when the `oneof` has multiple variants w
by tczMUFlmoNk 4y ago
> Also, using a `oneof` field is correctly typed on the frontend as
myfield: TypeA | TypeB | TypeC
But what about when the `oneof` has multiple variants with the same base type? Like:
message User {
oneof contact_info {
string email = 1;
string phone_number = 2;
}
}
Does this get compiled down to `contact_info: string | string` on the frontend? How do you tell which variant was used without encoding the discriminant?