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
Hello, this is a general - and hopefuly naive - quetion. Being a nexus user from the early stage I am repeatedly in the need for a way to work and transform the nexus types.
Taking inspiration from typescript, I would absolutely love a way to create a new type from another type by whitelisting or blacklisting fields (like Pick and Omit). Other transformation types can be imagined.
I have been implementing tooling to generate new types around a given one (like the search result from the node type), but figuring a way to thus derive types is lost on me - except from registering fields as objects and use that in the definition block, but i'd like to offer a turnkey solution. Maybe by getting the generated "graphql-js" objects ?
It seems I can get infos about the types from the core export, but is that the way I should follow ? Is there something else ?
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
-
Hello, this is a general - and hopefuly naive - quetion. Being a nexus user from the early stage I am repeatedly in the need for a way to work and transform the nexus types.
Taking inspiration from typescript, I would absolutely love a way to create a new type from another type by whitelisting or blacklisting fields (like Pick and Omit). Other transformation types can be imagined.
I have been implementing tooling to generate new types around a given one (like the search result from the node type), but figuring a way to thus derive types is lost on me - except from registering fields as objects and use that in the definition block, but i'd like to offer a turnkey solution. Maybe by getting the generated "graphql-js" objects ?
It seems I can get infos about the types from the
core
export, but is that the way I should follow ? Is there something else ?Thanks a lot.
Beta Was this translation helpful? Give feedback.
All reactions