graphql.execution.nextgen.result.RootExecutionResultNode Maven / Gradle / Ivy
package graphql.execution.nextgen.result;
import graphql.GraphQLError;
import graphql.Internal;
import graphql.execution.ExecutionStepInfo;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import static graphql.Assert.assertShouldNeverHappen;
@Internal
public class RootExecutionResultNode extends ObjectExecutionResultNode {
public RootExecutionResultNode(List children, List errors) {
super(null, null, children, errors);
}
public RootExecutionResultNode(List children) {
super(null, null, children, Collections.emptyList());
}
@Override
public ExecutionStepInfo getExecutionStepInfo() {
return assertShouldNeverHappen("not supported at root node");
}
@Override
public ResolvedValue getResolvedValue() {
return assertShouldNeverHappen("not supported at root node");
}
@Override
public RootExecutionResultNode withNewChildren(List children) {
return new RootExecutionResultNode(children, getErrors());
}
@Override
public ExecutionResultNode withNewResolvedValue(ResolvedValue resolvedValue) {
return assertShouldNeverHappen("not supported at root node");
}
@Override
public ExecutionResultNode withNewExecutionStepInfo(ExecutionStepInfo executionStepInfo) {
return assertShouldNeverHappen("not supported at root node");
}
@Override
public ExecutionResultNode withNewErrors(List errors) {
return new RootExecutionResultNode(getChildren(), new ArrayList<>(errors));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy