Question · NestJS course · Module 1: NestJS Basics

Query Parameters in NestJS

How do you get a query parameter (e.g., ?from=rome) in a NestJS controller?

Answer options

  • @Query('from') from: string
  • @Body('from') from: string
  • @Param('from') from: string
  • @Path('from') from: string
Show the answer

Correct answer:

  • @Query('from') from: string