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 running in to a problem with typescript-resolvers where I have defined a generic to be used as a mapper for some fields, but when it's used with interfaces the behaviour is not what I would expect.
Consider this case, I have an interface Card with three implementing types. When the code generator runs with default behaviour, I get the following generated type:
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.
-
Hi! I'm running in to a problem with typescript-resolvers where I have defined a generic to be used as a mapper for some fields, but when it's used with interfaces the behaviour is not what I would expect.
Consider this case, I have an interface
Card
with three implementing types. When the code generator runs with default behaviour, I get the following generated type:However if I add this to the mapper:
Card: LinkableEntry<{T}>
the generated code becomesWhen what I would expect is the union of implementing types to be passed in, the same as the default behaviour.
Is there a way to get the behaviour I expect, instead of what occurs now?
Beta Was this translation helpful? Give feedback.
All reactions