Closed joelgriffith closed 5 years ago
Totally agreed with those concerns -- here's my hand wavy explanation of how I think this might be possible, but it's hand wavy because I'm not a GraphQL guru:
1) Parse GraphQL query into an array of Promise chains which resolve to the sequence of actual navalia / chrome API functions. This should result in n
Promises where n
is the number of leaf nodes in the query.
2) For each of these Promises, spawn a tab up to whatever the maximum specified number of tabs is.
3) Resolve each promise chain in its corresponding tab.
4) Continue until tabs have been spawned / resolved for each leaf node.
So, we shouldn't need to clone tabs, each tab will just execute the same series of steps in parallel up until the query branches.
Ah, that definitely removes some of the challenges related to having branching work as expected. I know this is entirely possible (things like join-monster do this), but would definitely take some meaty work to do so. I'll dig into how to do this, as it's a pretty interesting idea!
Really like this idea. Some thoughts I have: