The query function gets its generic inferred as string, which makes the return value from query become string[] given the definition of query. We do not currently have a query method like queryRequired that correctly returns [T, ...T[]] instead of T[].
Sample query:
Generates the following TypeScript function:
The
query
function gets its generic inferred asstring
, which makes the return value fromquery
becomestring[]
given the definition ofquery
. We do not currently have a query method likequeryRequired
that correctly returns[T, ...T[]]
instead ofT[]
.