Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- MySQL
- Express
- nodejs
- 게임
- Nest.js
- jest
- cookie
- game
- JavaScript
- MongoDB
- TypeScript
- 자료구조
- Bull
- Sequelize
- mongoose
- OCR
- class
- nestjs
- 공룡게임
- Dinosaur
- Python
- Queue
- typeORM
- dfs
- GIT
- flask
- react
- 정렬
- AWS
Archives
- Today
- Total
포시코딩
[GraphQL] Utility type in entity 본문
728x90
PartialType()
부모 DTO의 모든 속성을 물려받지만 전부 Optional
PickType()
부모 DTO의 속성 중 몇 개만 골라서 물려받음
OmitType()
부모 DTO의 속성 중 몇 개만 제외하고 물려받음
IntersectionType()
두 부모 DTO의 속성들을 모두 물려받음
PartialType(OmitType())
위와 같이 함께 사용하는 경우 (e.g. UPDATE DTO를 만들 때)
export class UpdateUserDto extends PartialType(CreateUserDto) {}
참고
728x90
'Node.js' 카테고리의 다른 글
[NestJS] Strategy, Guard 한 파일에 깔끔하게쓰기 (1) | 2024.01.30 |
---|---|
[Test] 외부 라이브러리 mock 시키기 (0) | 2023.12.26 |
[TypeORM] save, insert, update, upsert 동작 원리 (0) | 2023.12.21 |
[TypeORM] update 후 결과 리턴받기 메모용 (0) | 2023.12.21 |
[TypeORM] BeforeInsert() - Encrypting Passwords in Entity (0) | 2023.12.21 |