NestJS - InterceptorsWhat does a response transformation interceptor in NestJS primarily do?AModify the data before sending it back to the clientBChange the request headers before processingCHandle database connections automaticallyDLog incoming requests to the consoleCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand the role of interceptors in NestJSInterceptors can modify or transform the response data before it is sent to the client.Step 2: Identify what response transformation meansIt means changing the outgoing data, not the request or other unrelated tasks.Final Answer:Modify the data before sending it back to the client -> Option AQuick Check:Response transformation = Modify data [OK]Quick Trick: Response interceptors change outgoing data only [OK]Common Mistakes:Confusing request modification with response transformationThinking interceptors handle database tasksAssuming interceptors only log data
Master "Interceptors" in NestJS9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallPerf
More NestJS Quizzes Database with Prisma - Prisma migrations - Quiz 12easy Database with TypeORM - Repository pattern - Quiz 12easy Guards - Why guards control access - Quiz 13medium Guards - Guard binding levels - Quiz 12easy Interceptors - Logging interceptor - Quiz 11easy Interceptors - Why interceptors add cross-cutting logic - Quiz 8hard Middleware - Why middleware processes requests before handlers - Quiz 9hard Middleware - Why middleware processes requests before handlers - Quiz 4medium Pipes - Custom pipes - Quiz 12easy Pipes - Built-in pipes (ParseIntPipe, ParseBoolPipe) - Quiz 13medium