Update return entity type
Didn't find this in the docs or through questions here.
I want typescript to respect the return type that has foreign relationships returned. For example, I have this query: But it is selecting some related tables: Is there a way to update it so that when I access this return type on the frontend I get typescript completion for the included tables? I can't seem to find a way to do this from the
Thanks!!!
I want typescript to respect the return type that has foreign relationships returned. For example, I have this query: But it is selecting some related tables: Is there a way to update it so that when I access this return type on the frontend I get typescript completion for the included tables? I can't seem to find a way to do this from the
main.wasp
file.Thanks!!!
4 Replies
Hey @Dayne, excellent question and sorry for the late reply. Happy Holidays btw!
The short version is: Wasp does not yet support this in the cleanest imaginable way, but it's definitely possible! We'll have cleaner support in a couple of weeks!
Since another one of our users asked the exact same question a couple of days ago, here's the thread: https://discord.com/channels/686873244791210014/1186410195732140073/1186410195732140073. I think you'll find your solution inside π
Let me know if you run into any kind of issue and I'll be glad to help you out!
Thanks! I went with option 1 you listed for now and that seems to work. I haven't attempted to deploy yet so unsure of hitting this issue
This is also blocking me from successfully deploying to Fly.io
that KYAN1TE
mentioned. I will just cross that bridge when I get there. πWohooo @Dayne, you just became a Waspeteer level 2!
Happy to help! There shouldn't be any issues during deployment, but let us know if there are π