You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Shows incorrect count number by using selectRelationCount previewFeatures #8050
I have a list of posts and each post has multiple comments. I was counting the total comments that each post has. Using selectRelationCount previewFeatures, its count number is correct but it shows different references. like:
post id 1 has 2 comments
post id 2 has 4 comments
post id 3 has 0 comment
post id 4 has 0 comment
query result shows:
post id 1 has 0 comments
post id 2 has 0 comments
post id 3 has 4 comment
post id 4 has 2 comment
@matthewmueller , check out the source code. Note: normal queries are ok for relational counts. But when use cursor & skip for pagination then that incorrect count number happens.
I'm seeing this happen on 2.30.3 - have tried removing where, skip / take, orderBy, without success. Counts and length of selected relations don't match.
Activity
matthewmueller commentedon Jul 6, 2021
Hey @ikramhasib007, can you share an example schema and script so we can reproduce?
ikramhasib007 commentedon Jul 6, 2021
schema.prismaFileschema.graphqlFileQueries resolvers
package.json@matthewmueller , check out the source code.
Note: normal queries are ok for relational counts. But when use
cursor&skipfor pagination then that incorrect count number happens.oceandrama commentedon Aug 6, 2021
Have the similar problem here, even without using
skiporcursorSchema:
Query:
Result (attention to groups with id 12 and 14):
pantharshit00 commentedon Aug 9, 2021
Thanks for the details, I can reproduce this now.
Posted minimal reproduction here: https://github.com/harshit-test-org/prisma-issue-8050
mart2967 commentedon Sep 5, 2021
I'm seeing this happen on 2.30.3 - have tried removing where, skip / take, orderBy, without success. Counts and length of selected relations don't match.
janpio commentedon Sep 5, 2021
Can you open a separate issue please @mart2967 and provide all the information the issue template asks for? Thanks.