Prisma client crashes when counting m-n self-relation #7807
Labels
bug/2-confirmed
Bug has been reproduced and confirmed.
kind/bug
A reported bug.
team/client
Issue for team Client.
topic: selectRelationCount
Milestone
Bug description
Running a basic findUnique which includes
Crashes prisma with this error:
The user model contains this:
If i remove the followers: true variable, and leave only the posts count, that works correctly.
How to reproduce
Create a model, add an m-n self relation to it, then run a query which includes the count of one of those relations
Expected behavior
It should either return the count, or throw a nice error message. At the moment it crashes
Prisma information
Environment & setup
MacOS, PostgreSQL database
Node is: v16.3.0
Prisma Version
The text was updated successfully, but these errors were encountered: