Question · NestJS course · Module 2: Routing and Request Lifecycle

The data Argument in createParamDecorator

What does the 'data' argument represent in createParamDecorator((data, ctx) => ...)? E.g., when using @CurrentUser('rank').

Answer options

  • The HTTP request object
  • The value passed to the decorator (here: 'rank')
  • The execution context (ExecutionContext)
  • HTTP headers
Show the answer

Correct answer:

  • The value passed to the decorator (here: 'rank')