NestJS · Senior · Question 57 of 75

How do you write a guard that works for HTTP and GraphQL?

Explanation

AuthGuard from Passport also needs getRequest() overridden for GraphQL.

Further reading

Problem with a question

NestJS · Senior · question 57

Test yourself

Take the NestJS · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz