TypedQuery is a decorator function that can parse URL query string. It is almost
same with nest.Query, but it can automatically cast property type following
its DTO definition. Also, TypedQuery performs type validation.
For reference, target type T must follow such restriction. Also, if
actual URL query parameter values are different with their promised type T,
BadRequestException error (status code: 400) would be thrown.
Type T must be an object type
Do not allow dynamic property
Only boolean, bigint, number, string or their array types are allowed
Type safe URL query decorator.
TypedQuery
is a decorator function that can parse URL query string. It is almost same with nest.Query, but it can automatically cast property type following its DTO definition. Also,TypedQuery
performs type validation.For reference, target type
T
must follow such restriction. Also, if actual URL query parameter values are different with their promised typeT
,BadRequestException
error (status code: 400) would be thrown.T
must be an object typeboolean
,bigint
,number
,string
or their array types are allowed