-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Support Lazy Enumerators with Stream #4907
Comments
We're currently looking into using streaming more for our APIs for the https://shop.app. Because the current lack of support for lazy enumerators, per this issue, we have all such APIs separate from our main APIs, and don't use GraphQL. Big ❤️ for this. |
Hey, thanks for chiming in, @tgwizard. I started looking into the implementation for this and determined it was going to be ... tricky. It's still definitely my goal ... but no low-hanging fruit here 😅 |
@rmosolgo yeah, I got that from the trampolining comment in the PR 😄 However I can help I'd be happy to do it. |
Currently
@stream
will defer child selections on list items, but all items are enumerated before any child selections are run.A better workflow might be that, when a
@stream
ed list is resolved, there's no call to.each
right away. Instead, and empty list is put in the response, and then each deferral gets the item it needs and resolves its subfields.Here's a script to demonstrate the behavior in question:
`@stream` with lazy enumeration
It should alternate between
yield
andresolve
messages, but instead, it does all theyield
s then all theresolve
s.If the implementation supported lazy enumeration, then you could use
@stream
to break up database requests into smaller chunks using a cursor.The text was updated successfully, but these errors were encountered: