DEV Community

Discussion on: Building NestJS app boilerplate - Authentication, Validation, GraphQL and Prisma

Collapse
 
abumalick profile image
abumalick

Thank you very much for your tutorial, it was very helpful.

In Nest v7 you don't really need to create custom Decorators, you can use the @Context decorator from graphql package:

import {Args, Context, Mutation, Resolver} from '@nestjs/graphql'

// and in your mutation:
@Mutation()
  async login(
    @Args('loginInput') { email, password }: LoginInput,
    @Context('res') res: Response,
  ) {
Enter fullscreen mode Exit fullscreen mode

Thank you again