import { PipeTransform , Injectable , ArgumentMetadata } from '@nestjs/common' ; import { UsersService } from './users.service' ; @ Injectable ( ) export class UserByIdPipe implements PipeTransform < string > { constructor ( private readonly usersService ) { } transform ( value , metadata ) { return this . usersService . getById ( value ) ; } }