Package graphql.schema
Class SchemaTraverser
java.lang.Object
graphql.schema.SchemaTraverser
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Function
<? super GraphQLSchemaElement, ? extends List<GraphQLSchemaElement>> -
Constructor Summary
ConstructorsConstructorDescriptionSchemaTraverser
(Function<? super GraphQLSchemaElement, ? extends List<GraphQLSchemaElement>> getChildren) -
Method Summary
Modifier and TypeMethodDescriptiondepthFirst
(GraphQLTypeVisitor graphQLTypeVisitor, GraphQLSchemaElement root) depthFirst
(GraphQLTypeVisitor graphQLTypeVisitor, Collection<? extends GraphQLSchemaElement> roots) depthFirst
(Traverser<GraphQLSchemaElement> traverser, SchemaTraverser.TraverserDelegateVisitor traverserDelegateVisitor, Collection<? extends GraphQLSchemaElement> roots) depthFirstFullSchema
(GraphQLTypeVisitor typeVisitor, GraphQLSchema schema) This will visit all of the schema elements in the specified schema and invokes the visitor.depthFirstFullSchema
(List<GraphQLTypeVisitor> typeVisitors, GraphQLSchema schema, Map<Class<?>, Object> rootVars) This will visit all of the schema elements in the specified schema, invoking each visitor in turn.private TraverserResult
doTraverse
(Traverser<GraphQLSchemaElement> traverser, Collection<? extends GraphQLSchemaElement> roots, SchemaTraverser.TraverserDelegateVisitor traverserDelegateVisitor) private Traverser
<GraphQLSchemaElement>
-
Field Details
-
getChildren
private final Function<? super GraphQLSchemaElement,? extends List<GraphQLSchemaElement>> getChildren
-
-
Constructor Details
-
SchemaTraverser
public SchemaTraverser(Function<? super GraphQLSchemaElement, ? extends List<GraphQLSchemaElement>> getChildren) -
SchemaTraverser
public SchemaTraverser()
-
-
Method Details
-
depthFirstFullSchema
This will visit all of the schema elements in the specified schema and invokes the visitor.- Parameters:
typeVisitor
- a list of visitors to useschema
- the schema to visit- Returns:
- a traversal result
-
depthFirstFullSchema
public TraverserResult depthFirstFullSchema(List<GraphQLTypeVisitor> typeVisitors, GraphQLSchema schema, Map<Class<?>, Object> rootVars) This will visit all of the schema elements in the specified schema, invoking each visitor in turn.- Parameters:
typeVisitors
- a list of visitors to useschema
- the schema to visitrootVars
- this sets up variables to be made available to theTraverserContext
. This can be empty but not null- Returns:
- a traversal result
-
depthFirst
-
depthFirst
public TraverserResult depthFirst(GraphQLTypeVisitor graphQLTypeVisitor, Collection<? extends GraphQLSchemaElement> roots) -
depthFirst
public TraverserResult depthFirst(Traverser<GraphQLSchemaElement> traverser, SchemaTraverser.TraverserDelegateVisitor traverserDelegateVisitor, Collection<? extends GraphQLSchemaElement> roots) -
initTraverser
-
doTraverse
private TraverserResult doTraverse(Traverser<GraphQLSchemaElement> traverser, Collection<? extends GraphQLSchemaElement> roots, SchemaTraverser.TraverserDelegateVisitor traverserDelegateVisitor)
-