title: How to inject service to validator constraint interface in nestjs using class-validator?
body: <p>I'm trying to inject my users service into my validator constraint interface but it doesn't seem to work:</p>
  
  <pre><code>import { ValidatorConstraintInterface, ValidatorConstraint, ValidationArguments, registerDecorator, ValidationOptions } from "class-validator";
  import { UsersService } from './users.service';
  
  @ValidatorConstraint({ async: true })
  export class IsEmailAlreadyInUseConstraint implements ValidatorConstraintInterface {
      constructor(private usersService: UsersService) {
          console.log(this.usersService);
      }
      validate(email: any, args: ValidationArguments) {
          return this.usersService.findUserByEmail(email).then(user =&gt; {
               if (user) return false;
               return true;
          });
          return false;
      }
  
  }
  </code></pre>
  
  <p>But, as usersService is logged null, I can't access its methods.</p>
  
  <p>Any insight on this matter?</p>