-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get type inference? #223
Comments
you have to do this by yourself. ...fetch(roomId) only has the Return-Type you may define a Type:
and then use it like:
|
Wish there was a better way? other than redefining |
This
I would much prefer if this was inferred from the schema when creating a repository like many other ORMs. It'd result in way fewer bugs and improve DX |
💯 - this would be very useful to have |
yea i end up having to define so many types eg. entity type, return from rest api type etc.. how can the typed repository fetch not even return the correct type? this is not even even a typescript library |
this doesnt work though it needs to |
this is a fake ts library |
I might be missing something trivial, but here's my case:
The error is:
That is because looks like there's no type inference. When I type "room." the properties doesn't show up. I tried creating a interface for Room and tried plugging into generics or casting but nothing worked...
I could check if room.members exists and then check if its type is array, is that what I'm supposed to do?
The text was updated successfully, but these errors were encountered: