5050import static graphql .schema .GraphQLTypeUtil .unwrapAll ;
5151
5252@ Internal
53- public class NormalizedQueryTreeFactory {
53+ public class NormalizedQueryFactory {
5454
5555 private final ValuesResolver valuesResolver = new ValuesResolver ();
5656 private final ConditionalNodes conditionalNodes = new ConditionalNodes ();
5757
58- public static NormalizedQueryTree createNormalizedQuery (GraphQLSchema graphQLSchema ,
59- Document document ,
60- String operationName ,
61- Map <String , Object > coercedVariableValues ) {
58+ public static NormalizedQuery createNormalizedQuery (GraphQLSchema graphQLSchema ,
59+ Document document ,
60+ String operationName ,
61+ Map <String , Object > coercedVariableValues ) {
6262 NodeUtil .GetOperationResult getOperationResult = NodeUtil .getOperation (document , operationName );
63- return new NormalizedQueryTreeFactory ().createNormalizedQueryImpl (graphQLSchema , getOperationResult .operationDefinition , getOperationResult .fragmentsByName , coercedVariableValues , null );
63+ return new NormalizedQueryFactory ().createNormalizedQueryImpl (graphQLSchema , getOperationResult .operationDefinition , getOperationResult .fragmentsByName , coercedVariableValues , null );
6464 }
6565
6666
67- public static NormalizedQueryTree createNormalizedQuery (GraphQLSchema graphQLSchema ,
68- OperationDefinition operationDefinition ,
69- Map <String , FragmentDefinition > fragments ,
70- Map <String , Object > coercedVariableValues ) {
71- return new NormalizedQueryTreeFactory ().createNormalizedQueryImpl (graphQLSchema , operationDefinition , fragments , coercedVariableValues , null );
67+ public static NormalizedQuery createNormalizedQuery (GraphQLSchema graphQLSchema ,
68+ OperationDefinition operationDefinition ,
69+ Map <String , FragmentDefinition > fragments ,
70+ Map <String , Object > coercedVariableValues ) {
71+ return new NormalizedQueryFactory ().createNormalizedQueryImpl (graphQLSchema , operationDefinition , fragments , coercedVariableValues , null );
7272 }
7373
74- public static NormalizedQueryTree createNormalizedQueryWithRawVariables (GraphQLSchema graphQLSchema ,
75- Document document ,
76- String operationName ,
77- Map <String , Object > rawVariables ) {
74+ public static NormalizedQuery createNormalizedQueryWithRawVariables (GraphQLSchema graphQLSchema ,
75+ Document document ,
76+ String operationName ,
77+ Map <String , Object > rawVariables ) {
7878 NodeUtil .GetOperationResult getOperationResult = NodeUtil .getOperation (document , operationName );
79- return new NormalizedQueryTreeFactory ().createNormalizedQueryImplWithRawVariables (graphQLSchema , getOperationResult .operationDefinition , getOperationResult .fragmentsByName , rawVariables );
79+ return new NormalizedQueryFactory ().createNormalizedQueryImplWithRawVariables (graphQLSchema , getOperationResult .operationDefinition , getOperationResult .fragmentsByName , rawVariables );
8080 }
8181
82- private NormalizedQueryTree createNormalizedQueryImplWithRawVariables (GraphQLSchema graphQLSchema ,
83- OperationDefinition operationDefinition ,
84- Map <String , FragmentDefinition > fragments ,
85- Map <String , Object > rawVariables
82+ private NormalizedQuery createNormalizedQueryImplWithRawVariables (GraphQLSchema graphQLSchema ,
83+ OperationDefinition operationDefinition ,
84+ Map <String , FragmentDefinition > fragments ,
85+ Map <String , Object > rawVariables
8686 ) {
8787
8888 List <VariableDefinition > variableDefinitions = operationDefinition .getVariableDefinitions ();
@@ -94,11 +94,11 @@ private NormalizedQueryTree createNormalizedQueryImplWithRawVariables(GraphQLSch
9494 /**
9595 * Creates a new Normalized query tree for the provided query
9696 */
97- private NormalizedQueryTree createNormalizedQueryImpl (GraphQLSchema graphQLSchema ,
98- OperationDefinition operationDefinition ,
99- Map <String , FragmentDefinition > fragments ,
100- Map <String , Object > coercedVariableValues ,
101- @ Nullable Map <String , NormalizedInputValue > normalizedVariableValues ) {
97+ private NormalizedQuery createNormalizedQueryImpl (GraphQLSchema graphQLSchema ,
98+ OperationDefinition operationDefinition ,
99+ Map <String , FragmentDefinition > fragments ,
100+ Map <String , Object > coercedVariableValues ,
101+ @ Nullable Map <String , NormalizedInputValue > normalizedVariableValues ) {
102102
103103
104104 FieldCollectorNormalizedQueryParams parameters = FieldCollectorNormalizedQueryParams
@@ -132,7 +132,7 @@ private NormalizedQueryTree createNormalizedQueryImpl(GraphQLSchema graphQLSchem
132132 1 );
133133
134134 }
135- return new NormalizedQueryTree (new ArrayList <>(collectFromOperationResult .children ), fieldToNormalizedField .build (), normalizedFieldToMergedField .build (), coordinatesToNormalizedFields .build ());
135+ return new NormalizedQuery (new ArrayList <>(collectFromOperationResult .children ), fieldToNormalizedField .build (), normalizedFieldToMergedField .build (), coordinatesToNormalizedFields .build ());
136136 }
137137
138138
@@ -322,7 +322,7 @@ private void collectField(FieldCollectorNormalizedQueryParams parameters,
322322 normalizedArgumentValues = valuesResolver .getNormalizedArgumentValues (fieldDefinition .getArguments (), field .getArguments (), parameters .getNormalizedVariableValues ());
323323 }
324324 ImmutableList <String > objectTypeNames = map (objectTypes , GraphQLObjectType ::getName );
325- NormalizedField normalizedField = NormalizedField .newQueryExecutionField ()
325+ NormalizedField normalizedField = NormalizedField .newNormalizedField ()
326326 .alias (field .getAlias ())
327327 .resolvedArguments (argumentValues )
328328 .normalizedArguments (normalizedArgumentValues )
0 commit comments