You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
export const supportedCurrenciesEnum = ['usd', 'eur', 'czk'] as const;
export type supportedCurrencyType = (typeof supportedCurrenciesEnum)[number];
// then in the fragment query i'm using this code:
fragment {
salePercentage {
czk
usd
eur
}
}
// then deep in the react code i'm trying to access the salePercentage value like this:
const currencyCode: supportedCurrencyType = 'czk';
salePercentage[currencyCode]
But the rule still complaining on the fields in the fragment:
This queries for the field `czk` but this file does not seem to use it directly. If a different file needs this information that file should export a fragment and colocate the query for the data with the usage.
If only interested in the existence of a record, __typename can be used without this warning.eslint(relay/unused-fields)
Hello,
I have the following typescript code:
But the rule still complaining on the fields in the fragment:
But when i access the salePercentage like this:
It works.
Do you have please any idea how to keep the easy access and don't use the second approach without the eslint warning?
Thank you
The text was updated successfully, but these errors were encountered: