Can't work out the Typescript syntax for an empty array #357
-
I can make a string array
But I can't work out the syntax to make an empty
both fail with compile errors (so I can't even get an object to attempt to cast to my type - as I would do for empty sets) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
You need to use
Docs: https://www.edgedb.com/docs/clients/01_js/types#custom-literals |
Beta Was this translation helpful? Give feedback.
-
Thanks! That "custom literals" info is on the Types page - not the Literals page of the documentation (where I was looking). Possibly some cross reference or something? The discussion for how to make Empty sets is on the Literals page, so I stopped looking there when I couldn't find anything about arrays. Thanks for an awesome db - am really enjoying using edgedb. |
Beta Was this translation helpful? Give feedback.
-
In practice on execution I was then getting an 'indeterminate type' message - so I had to add a cast as well (as per the empty set example)
|
Beta Was this translation helpful? Give feedback.
You need to use
e.literal
like this:Docs: https://www.edgedb.com/docs/clients/01_js/types#custom-literals