Closed jvassev closed 10 months ago
Yeah, I noticed that a while back, thanks for reporting. In the meantime, you can work around this by wrapping in e.assert_single(e.assert_exists(yourQuery))
. Will fix!
Might be related to #715
I don't understand this issue, right now if you use filter_single
the result is T | null
, what is wrong with this?
Oh, sorry, I think I misunderstood the original report: filter_single
will indeed give you T | null
as @sharifzadesina pointed out, so this is working as intended.
Code The code causing the error.
Schema
Your application schema.
Generated EdgeQL
No errors in edgeql
Error or desired behavior
No errors at compile time. At runtime, I expect an array of objects, however I get either null of a single element. I thinks it better to fix the inferred type to be
T | null
or wrap the single result in an array.Is there a workaround for this. Now I'm using
const myWidget: any
toVersions (please complete the following information):
2.0
): edgedb/edgedb:3 (docker image)2.0
): EdgeDB CLI 3.4.0+160d07dedgedb-js
version (e.g.0.20.10
;): 1.3.4@edgedb/generate
version (e.g.0.0.7
;): 0.3.3