import { Injectable , ExecutionContext } from '@nestjs/common' ; import { AuthGuard } from '@nestjs/passport' ; import { GqlExecutionContext } from '@nestjs/graphql' ; @ Injectable ( ) export class LocalAuthGuard extends AuthGuard ( 'local' ) { constructor ( ) { super ( ) ; } getRequest ( context ) { const gqlContext = GqlExecutionContext . create ( context ) ; const ctx = gqlContext . getContext ( ) ; ctx . req . body = gqlContext . getArgs ( ) . input ; return ctx . req ; } }