1111import java .util .List ;
1212import java .util .Map ;
1313
14- import static graphql .util .TreeTransformerUtil .changeNode ;
15-
1614public class DirectiveSchemaVisitor implements GraphQLTypeVisitor {
1715 private HashMap <String , AnnotationsDirectiveWiring > directiveWiringMap ;
1816 private GraphQLCodeRegistry .Builder codeRegistryBuilder ;
17+ private TreeTransformerUtilWrapper transformerUtilWrapper ;
1918
2019 @ FunctionalInterface
2120 interface WiringFunction {
@@ -27,18 +26,19 @@ GraphQLDirectiveContainer apply(GraphQLDirective a, GraphQLDirectiveContainer b,
2726 private Map <Class , WiringFunction > functionMap ;
2827
2928
30- public DirectiveSchemaVisitor (HashMap <String , AnnotationsDirectiveWiring > directiveWiringMap , GraphQLCodeRegistry .Builder codeRegistryBuilder ) {
29+ public DirectiveSchemaVisitor (HashMap <String , AnnotationsDirectiveWiring > directiveWiringMap , GraphQLCodeRegistry .Builder codeRegistryBuilder ,
30+ TreeTransformerUtilWrapper treeTransformerUtilWrapper ) {
3131 this .directiveWiringMap = directiveWiringMap ;
3232 this .functionMap = createFunctionsMap ();
3333 this .codeRegistryBuilder = codeRegistryBuilder ;
34+ this .transformerUtilWrapper = treeTransformerUtilWrapper ;
3435 }
3536
3637 @ Override
3738 public TraversalControl visitGraphQLArgument (GraphQLArgument node , TraverserContext <GraphQLSchemaElement > context ) {
3839 return this .visitGraphQLType (GraphQLArgument .class , node , context );
3940 }
4041
41-
4242 @ Override
4343 public TraversalControl visitGraphQLInterfaceType (GraphQLInterfaceType node , TraverserContext <GraphQLSchemaElement > context ) {
4444 return this .visitGraphQLType (GraphQLInterfaceType .class , node , context );
@@ -124,7 +124,7 @@ private TraversalControl visitGraphQLType(Class<? extends GraphQLDirectiveContai
124124 }
125125 }
126126 }
127- return changeNode (context , newNode );
127+ return transformerUtilWrapper . changeNode (context , newNode );
128128 }
129129
130130 private void putInMap (Map <Class , WiringFunction > map , Class clazz , String functionName ,
0 commit comments