[SOLVED] Object relation works when running app but doesn't compile to TypeScript?
My database schema looks as follows:
Meanwhile on my client when I do:
I get the following TypeScript error under task.
Property 'category' does not exist on type 'GetResult<{ id: number; description: string; isDone: boolean; userId: number | null; categoryId: number; }, unknown> & {}'. Did you mean 'categoryId'?ts(2551)
I have seen examples within the Wasp repo that allow this to work.
This is done by using the
However despite this, it still seems like I am missing a trick to get the type safety to understand that a
This is also blocking me from successfully deploying to Fly.io
Thanks
Meanwhile on my client when I do:
I get the following TypeScript error under task.
category.name:Property 'category' does not exist on type 'GetResult<{ id: number; description: string; isDone: boolean; userId: number | null; categoryId: number; }, unknown> & {}'. Did you mean 'categoryId'?ts(2551)
I have seen examples within the Wasp repo that allow this to work.
This is done by using the
includes part of the ORM like so:However despite this, it still seems like I am missing a trick to get the type safety to understand that a
Task is expected to reference Category (object) as well as the CategoryId?This is also blocking me from successfully deploying to Fly.io
Thanks