edgedb / edgedb-js

The official TypeScript/JS client library and query builder for EdgeDB
https://edgedb.com
Apache License 2.0
514 stars 65 forks source link

Use given cardinality in select expression #1043

Closed scotttrinh closed 5 months ago

scotttrinh commented 5 months ago

Previously, if you made a select expression with a constant or coalescing expression, we always calculated the cardinality of a object key based on the pointer's cardinality, rather than allowing you to return something assignable to that cardinality. This change will check if the assignment is possible, and override the cardinality when converting the query builder expression to a TS type.