NestJS · Junior · Question 71 of 75
What does PartialType(CreateUserDto) give you?
export class UpdateUserDto extends PartialType(CreateUserDto) {}- 1A copy of the DTO without validation
- ✓Correct answer: A DTO with the same fields and validation rules, but all fields optional, which suits PATCH requests
- 3A DTO with only the required fields
Explanation
Mapped types (PartialType, PickType, OmitType, IntersectionType) come from @nestjs/mapped-types or @nestjs/swagger and keep validation and docs metadata.