NestJS · Junior · Question 72 of 75
What does @Query('limit', new DefaultValuePipe(20), ParseIntPipe) limit: number do when limit is missing?
- 1Responds with 400
- 2Passes
undefined - ✓Correct answer: Uses 20, then parses it as an integer
Explanation
Pipes run in order. DefaultValuePipe fills in a value before ParseIntPipe validates it.