Looking at this type generated from a graphql schema:
export type UserPageEntry = {
readonly __typename?: 'UserPageEntry'
}
I am interested in retrieving the string representation of its only property type ('UserPageEntry') during compile time. This way, I can eliminate the hardcoded string 'UserPageEntry' in the code snippet below:
cache.modify({
optimistic: true,
id: `UserPageEntry:${userId}`,
My goal was to utilize an indexed access type like so:
type x = UserPageEntry['__typename']
...
and then use it as ${x.toString()}:${userId}
,
Is there a way to access the default value of this property or is it wiped out?