edgedb-js
edgedb-js copied to clipboard
Wrong property types when access a link
Code
The case when it's ok
const userSubscriptions = e.select(e.User, () => ({
subscriptions: subscription => ({
role: subscription['@role']
})
}))
// (parameter) user: {
// subscriptions: {
// role: number | null;
// }[];
// } | null
userSubscriptions.run().then(user => {})
Now I access the property subscriptions: the role is being erased and the default { id: string } is put instead.
const subscriptions = e.select(e.User, () => ({
subscriptions: subscription => ({
role: subscription['@role']
})
})).subscriptions
// (parameter) subscriptions: {
// id: string;
// }[]
subscriptions.run().then(subscriptions => {})
But when running the query, the result contains role property, not id
Versions (please complete the following information):
- EdgeDB CLI version (e.g.
2.0):4.0.2+be1da73 -
edgedb-jsversion (e.g.0.20.10;):1.4.1 -
@edgedb/generateversion (e.g.0.0.7;):0.4.1 - TypeScript version:
Version 5.4.0-dev.20240120