I am facing a challenge with an enum type called Currency
. I am unable to modify it because it is automatically generated in a graphql schema. However, I need to utilize it for my data but I'm unsure of how to go about doing so.
enum Currency {
rub = 'RUB',
usd = 'USD',
eur = 'EUR',
}
const data: { currency: Currency[keyof typeof Currency] } = {
currency: 'RUB',
};
Issues:
TS2339: Property 'eur' does not exist on type 'Currency'.
TS2339: Property 'rub' does not exist on type 'Currency'.
TS2339: Property 'usd' does not exist on type 'Currency'.