Nested Where Clause in Many-to-Many relation using Query

Hello, I have a many-to-many relationship between my events categories table.' As of now, I am trying to filter this data by joining my events table with the junction table (eventToCategories) and then the junction table with categories table. When attempting to use the where clause in the categories table so I could filter by certain events, typescript told me that the where clause was not allowed to be used here. I am not fully sure why this is the case, but I was wondering if anyone had a solution to this? I will attach my query as well as schema things in this. Thank you.
No description
No description
No description
No description
4 Replies
chico
chico7mo ago
what is the underline hover message? can you move the where clause to below the includes true
Kwanza
KwanzaOP7mo ago
This is the issue the hover message and shows the same result whether I move it below the the includes
No description
Kwanza
KwanzaOP7mo ago
I also tried to add the where clause where I would ideally like it (this is in order to determine if an event's categories are in the selected array of categories determined by the user). Interestingly enough, this removes the underline error I was having before
No description
Kwanza
KwanzaOP7mo ago
Basically my issue here is that I need a way to filter this category table, but I am not able to get access the where clause so I cannot filter
Want results from more Discord servers?
Add your server