Types
Referenced
In TypeScript, a referenced type is a type definition declared with a specific name, allowing it to be referred to or reused elsewhere in the code.
Referenced type names will be used as the name for the generated GraphQL object type.
For comparison, see inline types.
Example
In this example, the UserWithoutName
referenced type is utilized as the object type name instead of the automatically generated inline type name OmitUsername
derived from Omit<User, 'name'>
.
This showcases how the explicitly named referenced type contributes to the clarity and semantic coherence of the generated GraphQL object type.