01 / 05

What is the difference between UseGuards, UseInterceptors, UsePipes, and UseFilters — can they all be applied at the same levels?

All four decorators can be applied at method level, controller (class) level, or globally. The key execution-order difference is that guards, interceptors, and pipes run global → controller → method, while exception filters resolve method → controller → global with the most specific filter winning.

All four applied at all three binding levels
Execution order summary:
  1. 1

    Guards — global → controller → method. All must pass for the request to continue.

  2. 2

    Interceptors — global → controller → method (pre). Method → controller → global (post).

  3. 3

    Pipes — global → controller → method. Each processes its bound parameter.

  4. 4

    Filters — method → controller → global. First matching @Catch() type wins.

  5. 5

    app.useGlobal*() registers without DI support; APP_* tokens register with full DI.