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

graphql.nadel.engine.result.ResultNodeTraverser Maven / Gradle / Ivy

Go to download

Nadel is a Java library that combines multiple GrahpQL services together into one API.

The newest version!
package graphql.nadel.engine.result;

import graphql.Internal;
import graphql.util.Traverser;
import graphql.util.TraverserVisitor;

import java.util.Collection;

@Internal
public class ResultNodeTraverser {

    private final Traverser traverser;

    private ResultNodeTraverser(Traverser traverser) {
        this.traverser = traverser;
    }

    public static ResultNodeTraverser depthFirst() {
        return new ResultNodeTraverser(Traverser.depthFirst(ExecutionResultNode::getChildren, null, null));
    }

    public void traverse(TraverserVisitor visitor, ExecutionResultNode root) {
        traverser.traverse(root, visitor);
    }

    public void traverse(TraverserVisitor visitor, Collection roots) {
        traverser.traverse(roots, visitor);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy