use of graphql.execution.nextgen.result.ExecutionResultNode in project graphql-java by graphql-java.
the class BatchedExecutionStrategy method resolveZipper.
private NodeZipper<ExecutionResultNode> resolveZipper(NodeZipper<ExecutionResultNode> unresolvedNodeZipper, List<FetchedValueAnalysis> fetchedValuesForNode) {
UnresolvedObjectResultNode unresolvedNode = (UnresolvedObjectResultNode) unresolvedNodeZipper.getCurNode();
List<ExecutionResultNode> newChildren = util.fetchedValueAnalysisToNodes(fetchedValuesForNode);
ObjectExecutionResultNode newNode = unresolvedNode.withNewChildren(newChildren);
return unresolvedNodeZipper.withNewNode(newNode);
}
use of graphql.execution.nextgen.result.ExecutionResultNode in project graphql-java by graphql-java.
the class BatchedExecutionStrategy method resolveNodes.
// all multizipper have the same root
private CompletableFuture<NodeMultiZipper<ExecutionResultNode>> resolveNodes(ExecutionContext executionContext, List<NodeMultiZipper<ExecutionResultNode>> unresolvedNodes) {
assertNotEmpty(unresolvedNodes, () -> "unresolvedNodes can't be empty");
ExecutionResultNode commonRoot = unresolvedNodes.get(0).getCommonRoot();
CompletableFuture<List<List<NodeZipper<ExecutionResultNode>>>> listListCF = Async.flatMap(unresolvedNodes, executionResultMultiZipper -> fetchAndAnalyze(executionContext, executionResultMultiZipper.getZippers()));
return flatList(listListCF).thenApply(zippers -> new NodeMultiZipper<ExecutionResultNode>(commonRoot, zippers, RESULT_NODE_ADAPTER));
}
Aggregations