Bird
0
0

What does the intercept method in a NestJS interceptor receive as its first argument?

easy📝 Conceptual Q1 of 15
NestJS - Interceptors
What does the intercept method in a NestJS interceptor receive as its first argument?
ACallHandler object
BExecutionContext object
CRequest object
DResponse object
Step-by-Step Solution
Solution:
  1. Step 1: Understand the intercept method signature

    The intercept method always receives two arguments: ExecutionContext and CallHandler.
  2. Step 2: Identify the first argument

    The first argument is the ExecutionContext, which provides details about the current request lifecycle.
  3. Final Answer:

    ExecutionContext object -> Option B
  4. Quick Check:

    intercept first argument = ExecutionContext [OK]
Quick Trick: intercept always starts with ExecutionContext first [OK]
Common Mistakes:
  • Confusing CallHandler as first argument
  • Thinking request or response objects are direct arguments
  • Mixing up argument order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NestJS Quizzes