You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 @streamed 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:
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 😅
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: