Skip to content

question: how to validate array.length? #2552

Open
@toknT

Description

@toknT

I am using nestjs+gql it's the code

@InputType()
export class InsertSessionsInput {
  @Max(1000, { message: 'limit 1000 items' })
  @Field(() => [InMemoSession])
  sessions: InMemoSession[];
}

The problem:

it check the length of object.toString() not the length of array,

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: questionQuestions about the usage of the library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions