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

types(querycursor): correct cursor async iterator type with populate() support #14384

Merged
merged 5 commits into from Feb 27, 2024

Conversation

vkarpov15
Copy link
Collaborator

Fix #14374

Summary

Right now, using for await with a cursor doesn't quite work in TypeScript: you get DocType[] rather than ResultType. Similarly, that means populate<Paths>() doesn't work right with cursor().

Examples

Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

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

Looks good, some small suggestions / question

test/types/querycursor.test.ts Outdated Show resolved Hide resolved
test/types/querycursor.test.ts Outdated Show resolved Hide resolved
@hasezoey hasezoey added the typescript Types or Types-test related issue / Pull Request label Feb 26, 2024
@vkarpov15 vkarpov15 added this to the 8.2.1 milestone Feb 27, 2024
@vkarpov15 vkarpov15 merged commit c02141b into master Feb 27, 2024
5 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-14374 branch February 27, 2024 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Types or Types-test related issue / Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Populate with TypeScript not working on Cursor
2 participants