Registering a global enhancer through the DI system using special tokens (APP_GUARD, APP_PIPE, APP_INTERCEPTOR, APP_FILTER) so the enhancer can inject services. This is the preferred approach over app.useGlobalGuards() for any enhancer that has dependencies like JwtService or Reflector.
How would you add a global authentication guard to all routes in a NestJS app using APP_GUARD?
What happens if you register a validation pipe using APP_PIPE but forget to import ValidationPipe from '@nestjs/common'?
A user reports that POST requests are failing with 400 errors, but the validation pipe logs show no output — how would you debug whether APP_PIPE is even being applied?
You added a global guard to restrict access to admin routes, but now some public endpoints are blocked — what’s likely wrong, and how would you fix it?
You’re migrating a legacy NestJS app to use modular guards instead of global ones — what edge cases might break when replacing APP_GUARD with module-scoped guards, and how would you test for them?
How would you design a system where different microservices use different APP_PIPE implementations for request validation, while avoiding duplication and ensuring consistent error responses?
You’re leading a cross-team migration from global APP_GUARD/APP_PIPE to per-module implementations across 12 services — what architectural tradeoffs do you consider for maintainability, rollout risk, and observability?
How would you design a long-term strategy to phase out legacy APP_PIPE logic that’s tightly coupled to deprecated DTOs, while ensuring zero downtime and backward compatibility for external clients?