Open kostasb opened 4 months ago
The same type issue applies not just to aliased but to the reverse linked table records
const record = await xata.db.ShoppingCarts.select([
{
name: "<-ShoppingCartLineItems.shoppingCart",
columns: ["productId", "quantity", "type"],
},
]).getFirst();
console.log(record.<-lacks types);
anything under ShoppingCartLineItemsshoppingCart
(included) is not typed.
raw record response sample:
{
"ShoppingCartLineItemsshoppingCart": {
"records": [
{
"id": "rec_cq2eqoejtvt7ohj3uh70",
"productId": "pid1",
"quantity": 1,
"type": "item",
"xata": {
"createdAt": "2024-07-03T06:19:13.319792+00:00",
"updatedAt": "2024-07-03T06:19:13.319792+00:00",
"version": 0
}
}
]
},
"id": "rec_cq2eqjskrmoddioegtv0",
"xata": {
"createdAt": "2024-07-03T06:18:55.023Z",
"updatedAt": "2024-07-03T06:18:55.023Z",
"version": 0
}
}
Reported on client version: 0.29.5
When aliasing a reverse link result with
as
, the alias is not typed in the returned object.