For comparison, see inline types.
Example
UserWithoutName referenced type is utilized as the object type name instead of the automatically generated inline type name OmitUsername derived from Omit<User, 'name'>.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
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.
interface User {
id: string;
name: string;
}
type UserWithoutName = Omit<User, 'name'>;
@graphql.resolver()
class UserResolver {
@graphql.query()
getUserId(): UserWithoutName {
// ...
}
}
UserWithoutName referenced type is utilized as the object type name instead of the automatically generated inline type name OmitUsername derived from Omit<User, 'name'>.
type UserWithoutName {
id: String!
}
type Query {
getUserId: UserWithoutName
}
Was this page helpful?
