All Downloads are FREE. Search and download functionalities are using the official Maven repository.

graphql.execution.nextgen.result.RootExecutionResultNode Maven / Gradle / Ivy

There is a newer version: 230521-nf-execution
Show newest version
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 - 2024 Weber Informatics LLC | Privacy Policy