Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CountOptions are not included in PaginateOptions #73

Open
pbatr opened this issue Oct 11, 2024 · 1 comment
Open

CountOptions are not included in PaginateOptions #73

pbatr opened this issue Oct 11, 2024 · 1 comment

Comments

@pbatr
Copy link

pbatr commented Oct 11, 2024

We are running into the problem that totalCount is wrong when using paginate with inner joins (most likely only with many-to-many relations but did not dig deeper). A workaround is to pass distinct: true parameter to .paginate() because since 401972b the query args are passed also to .count() and that fixes the issue. But now typescript is complaining because .paginate() only takes FindOptions and that type does not include distinct.

I would suggest to either update the type to include also CountOptions or include distinct: true in totalCountQueryOptions and cursorCountQueryOptions.

@duncanhoggan
Copy link

I'm also having this issue, would be a great addition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants