CodeZettaInterview Hub

NestJS · Interceptors · Junior · Comparison

Interceptor vs middleware vs filter — response mapping?

Short Interview Answer

Interceptors map successful responses; exception filters map errors; middleware is lower-level and less Nest-context rich.

Detailed Explanation

Use ClassSerializerInterceptor for entity shaping. Keep mapping explicit when possible.

Did you know this answer?