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

Make WithFilter output type compatible with Apollo Server subscriptions #276

Merged
merged 2 commits into from
Nov 5, 2024

Conversation

tninesling
Copy link
Contributor

Subscriptions require an AsyncIterable, but withFilter was returning an AsyncIterator. This updates the type of withFilter to acknowledge it returns a type which is both an AsyncIterable and an AsyncIterator.

@tninesling
Copy link
Contributor Author

This is a rework of #275.

Copy link
Member

@glasser glasser left a comment

Choose a reason for hiding this comment

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

OK, I think this makes sense. It's just promising that withFilter will return something that's doubly-useful  — something you can use in an API expecting an Iterable or an API expecting an Iterator.

The WithFilter type is a bit weird — it seems like you could just use typeof<withFilter> instead or something. But I think that makes sense too.

@tninesling tninesling merged commit 6c07092 into release-3.0 Nov 5, 2024
3 checks passed
@tninesling tninesling deleted the tninesling/subscription-type-fix branch November 5, 2024 22:54
@tninesling tninesling mentioned this pull request Nov 5, 2024
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