Bird
0
0

What does a response transformation interceptor in NestJS primarily do?

easy📝 Conceptual Q1 of 15
NestJS - Interceptors
What does a response transformation interceptor in NestJS primarily do?
AModify the data before sending it back to the client
BChange the request headers before processing
CHandle database connections automatically
DLog incoming requests to the console
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of interceptors in NestJS

    Interceptors can modify or transform the response data before it is sent to the client.
  2. Step 2: Identify what response transformation means

    It means changing the outgoing data, not the request or other unrelated tasks.
  3. Final Answer:

    Modify the data before sending it back to the client -> Option A
  4. Quick Check:

    Response transformation = Modify data [OK]
Quick Trick: Response interceptors change outgoing data only [OK]
Common Mistakes:
  • Confusing request modification with response transformation
  • Thinking interceptors handle database tasks
  • Assuming interceptors only log data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NestJS Quizzes