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
Hi!. I'm wondering if it's possible either from a plugin or the core, to dump a Type Map, that is an object with key, every type in the schema and value, a typeof of the type in the generated schema file?
// ...exporttypeUser={__typename?: 'User'id: Scalars['Int']username: Scalars['String']};exporttypeUserProfile={__typename?: 'UserProfile'id: Scalars['Int']firstName: Scalars['String']}// This right here is what I'm interested intypeAllTypes={User: UserUserProfile: UserProfile}
I see AllTypes type map being beneficial for typing a number of other things. My immediate need is to improve the typing ApolloClient especially in the typePolicies field of InMemoryCache for things like typePolicies.*keyFields, fields.*. typePolicies can be a map with key in keyof AllTypes. keyFields in keyof AllTypes[key] and so on.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!. I'm wondering if it's possible either from a plugin or the core, to dump a Type Map, that is an object with key, every type in the schema and value, a
typeof
of the type in the generated schema file?Given:
Something in the shape:
I see
AllTypes
type map being beneficial for typing a number of other things. My immediate need is to improve the typing ApolloClient especially in thetypePolicies
field ofInMemoryCache
for things liketypePolicies.*
keyFields
,fields.*
.typePolicies
can be a map with key inkeyof AllTypes
.keyFields
inkeyof AllTypes[key]
and so on.Beta Was this translation helpful? Give feedback.
All reactions