on 10-31-2022 11:27 AM
On CAP 6.2.3, if we use Deep READ:
SELECT.from(User)
.columns((u) => {
u('*')
u.userGroupUsers((ugu) => {
ugu('*')
});
})
We will get an error when compile the Typescript code:
Property userGroupUsers does not exits on type 'Definition'.
Hope we can update the Typescript Type for this one.
Hi Andrew,
you are right, the types are lacking a bit of detail on the model side. We are currently looking into providing a solution for users that need types for their model – so stay tuned for that!
In the meantime, you could try to fool Typescript with the following:
SELECT.from(User)
.columns((u) => {
u('*')
(u as unknown as User).userGroupUsers((ugu) => {
ugu('*')
});
})
which should hopefully give you the desired results.
Best regards,
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andrew,
sorry to hear you are running into troubles during the update! I'm afraid I am not entirely clear on which behaviour you were encountering before the update. As far as I am aware, the new version was supposed to be backwards compatible in that regard.
Could you maybe provide us with more details as to what version of CDS you are upgrading from, what parts of the API you noticed to have changed, and maybe even a repository with a minimal reproducible example?
Best,
Daniel
Hi,
We have a lot of issues during the upgrade, not only the Definition, the most trouble for us is the .send API
We following the same code on the above link, it's working fine on cds 5.9.8, but on cds 6.3.1, it will give this error:
No overload matches this call.
Overload 1 of 3, '(event: Events, data?: object, headers?: object): Promise<Transaction>', gave the following error.
Argument of type '{ method: string; path: string; data: { userID: any; convert: boolean; }; headers: { authorization: string; }; }' is not
assignable to parameter of type 'Events'
Thanks for sharing, i just adjusted the typings for that specific API. Could you still provide some samples where it happens, so i can confirm it is fixed? Thanks!
User | Count |
---|---|
72 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.