use of graphql.execution.nextgen.result.ResolvedValue in project graphql-java by graphql-java.
the class ResultNodesCreator method createResultNode.
public ExecutionResultNode createResultNode(FetchedValueAnalysis fetchedValueAnalysis) {
ResolvedValue resolvedValue = createResolvedValue(fetchedValueAnalysis);
ExecutionStepInfo executionStepInfo = fetchedValueAnalysis.getExecutionStepInfo();
if (fetchedValueAnalysis.isNullValue() && executionStepInfo.isNonNullType()) {
NonNullableFieldWasNullException nonNullableFieldWasNullException = new NonNullableFieldWasNullException(executionStepInfo, executionStepInfo.getPath());
return new LeafExecutionResultNode(executionStepInfo, resolvedValue, nonNullableFieldWasNullException);
}
if (fetchedValueAnalysis.isNullValue()) {
return new LeafExecutionResultNode(executionStepInfo, resolvedValue, null);
}
if (fetchedValueAnalysis.getValueType() == FetchedValueAnalysis.FetchedValueType.OBJECT) {
return createUnresolvedNode(fetchedValueAnalysis);
}
if (fetchedValueAnalysis.getValueType() == FetchedValueAnalysis.FetchedValueType.LIST) {
return createListResultNode(fetchedValueAnalysis);
}
return new LeafExecutionResultNode(executionStepInfo, resolvedValue, null);
}
use of graphql.execution.nextgen.result.ResolvedValue in project graphql-java by graphql-java.
the class DefaultExecutionStrategy method resolveNode.
private CompletableFuture<NodeZipper<ExecutionResultNode>> resolveNode(ExecutionContext executionContext, NodeZipper<ExecutionResultNode> unresolvedNode) {
ExecutionStepInfo executionStepInfo = unresolvedNode.getCurNode().getExecutionStepInfo();
ResolvedValue resolvedValue = unresolvedNode.getCurNode().getResolvedValue();
FieldSubSelection fieldSubSelection = util.createFieldSubSelection(executionContext, executionStepInfo, resolvedValue);
return resolveSubSelection(executionContext, fieldSubSelection).thenApply(resolvedChildMap -> unresolvedNode.withNewNode(new ObjectExecutionResultNode(executionStepInfo, resolvedValue, resolvedChildMap)));
}
Aggregations