Prisma: filter include statement by nullable relation, exclude when null
I have the following code, being used to get a cart on a user session.
This results in the following error:
The items all need a product so that i can calculate a price. Unfortunately I have to work off an older schema as this is a rewrite of a site that was previously written using ASP.NET. The previous developer used the
Item
model for multiple purposes hence why it doesn't always correlate to a product, and instead sometimes to an order.
I understand the problem here but cannot reach a solution that doesn't involve manually casting to the non-nullable type, which I'd like to try and avoid.0 Replies