import { createParamDecorator , ExecutionContext } from '@nestjs/common' ; import { GqlExecutionContext } from '@nestjs/graphql' ; export interface TokenUser { id : number ; } export const User = createParamDecorator ( ( _ , context ) => { const ctx = GqlExecutionContext . create ( context ) ; return ctx . getContext ( ) . req . user ; } ) ;