Skip to content

make Query interface generics consistent with Mongoose 8.15 re: #218 #233

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

Merged
merged 1 commit into from
May 28, 2025

Conversation

vkarpov15
Copy link
Contributor

#218 is a likely cause of #232 (and Automattic/mongoose#15423). In TypeScript 5, module augmentation generics need to be exactly identical, including default values and names. This PR makes it so that interface Query's generics line up with Mongoose 8.9.3+.

Unfortunately can't make it line up exactly because Mongoose made some changes to class Query generics in 8.6.0 and 8.9.3 because we weren't aware that anyone was using module augmentation with Query. TBH we didn't even know you could use module augmentation with classes 🫤 . Mongoose will keep this interface consistent in 8.x.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

@aravindnc aravindnc merged commit 79a1872 into aravindnc:main May 28, 2025
3 checks passed
@aravindnc
Copy link
Owner

Thank you :)

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

Successfully merging this pull request may close these issues.

2 participants