title: NestJS: How to transform an array in a @Query object
body: <p>I'm new to NestJS and I am trying to fill a filter DTO from query Parameters.</p>
  
  <p>Here is what I have:</p>
  
  <p>Query:</p>
  
  <p>localhost:3000/api/checklists?stations=114630,114666,114667,114668</p>
  
  <p>Controller</p>
  
  <pre><code>@Get()
  public async getChecklists(@Query(ValidationPipe) filter: ChecklistFilter): Promise&lt;ChecklistDto[]&gt; {
      // ...
  }
  </code></pre>
  
  <p>DTO</p>
  
  <pre><code>export class ChecklistFilter {
  
      @IsOptional()
      @IsArray()
      @IsString({ each: true })
      @Type(() =&gt; String)
      @Transform((value: string) =&gt; value.split(','))
      stations?: string[];
  
      // ...
  }
  </code></pre>
  
  <p>With this, the class validator does not complain, however, in the filter object stations is not actually an array but still a single string.</p>
  
  <p>I want to transform it into an array within the validation pipe. How can I achieve that?</p>