Skip to content

Commit d9b7a5b

Browse files
committed
cleanup NF/NQ naming
1 parent 5060b63 commit d9b7a5b

10 files changed

Lines changed: 80 additions & 80 deletions

File tree

src/main/java/graphql/execution/ExecutionContext.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
import graphql.language.Document;
1414
import graphql.language.FragmentDefinition;
1515
import graphql.language.OperationDefinition;
16-
import graphql.normalized.NormalizedQueryTree;
17-
import graphql.normalized.NormalizedQueryTreeFactory;
16+
import graphql.normalized.NormalizedQuery;
17+
import graphql.normalized.NormalizedQueryFactory;
1818
import graphql.schema.GraphQLSchema;
1919
import graphql.util.FpKit;
2020
import org.dataloader.DataLoaderRegistry;
@@ -54,7 +54,7 @@ public class ExecutionContext {
5454
private final Locale locale;
5555
private final ValueUnboxer valueUnboxer;
5656
private final ExecutionInput executionInput;
57-
private final Supplier<NormalizedQueryTree> queryTree;
57+
private final Supplier<NormalizedQuery> queryTree;
5858

5959
ExecutionContext(ExecutionContextBuilder builder) {
6060
this.graphQLSchema = builder.graphQLSchema;
@@ -77,7 +77,7 @@ public class ExecutionContext {
7777
this.errors.addAll(builder.errors);
7878
this.localContext = builder.localContext;
7979
this.executionInput = builder.executionInput;
80-
queryTree = FpKit.interThreadMemoize(() -> NormalizedQueryTreeFactory.createNormalizedQuery(graphQLSchema, operationDefinition, fragmentsByName, variables));
80+
queryTree = FpKit.interThreadMemoize(() -> NormalizedQueryFactory.createNormalizedQuery(graphQLSchema, operationDefinition, fragmentsByName, variables));
8181
}
8282

8383

@@ -205,7 +205,7 @@ public ExecutionStrategy getSubscriptionStrategy() {
205205
return subscriptionStrategy;
206206
}
207207

208-
public Supplier<NormalizedQueryTree> getNormalizedQueryTree() {
208+
public Supplier<NormalizedQuery> getNormalizedQueryTree() {
209209
return queryTree;
210210
}
211211

src/main/java/graphql/execution/ExecutionStrategy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import graphql.language.Argument;
2222
import graphql.language.Field;
2323
import graphql.normalized.NormalizedField;
24-
import graphql.normalized.NormalizedQueryTree;
24+
import graphql.normalized.NormalizedQuery;
2525
import graphql.schema.CoercingSerializeException;
2626
import graphql.schema.DataFetcher;
2727
import graphql.schema.DataFetchingEnvironment;
@@ -300,7 +300,7 @@ protected CompletableFuture<FetchedValue> fetchField(ExecutionContext executionC
300300
}
301301

302302
protected Supplier<NormalizedField> getNormalizedField(ExecutionContext executionContext, ExecutionStrategyParameters parameters, Supplier<ExecutionStepInfo> executionStepInfo) {
303-
Supplier<NormalizedQueryTree> normalizedQuery = executionContext.getNormalizedQueryTree();
303+
Supplier<NormalizedQuery> normalizedQuery = executionContext.getNormalizedQueryTree();
304304
return () -> normalizedQuery.get().getNormalizedField(parameters.getField(), executionStepInfo.get().getObjectType(), executionStepInfo.get().getPath());
305305
}
306306

src/main/java/graphql/execution/nextgen/ValueFetcher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import graphql.execution.directives.QueryDirectivesImpl;
2121
import graphql.language.Field;
2222
import graphql.normalized.NormalizedField;
23-
import graphql.normalized.NormalizedQueryTree;
23+
import graphql.normalized.NormalizedQuery;
2424
import graphql.schema.DataFetcher;
2525
import graphql.schema.DataFetchingEnvironment;
2626
import graphql.schema.DataFetchingFieldSelectionSet;
@@ -125,7 +125,7 @@ public CompletableFuture<FetchedValue> fetchValue(ExecutionContext executionCont
125125

126126
GraphQLOutputType fieldType = fieldDef.getType();
127127

128-
Supplier<NormalizedQueryTree> normalizedQuery = executionContext.getNormalizedQueryTree();
128+
Supplier<NormalizedQuery> normalizedQuery = executionContext.getNormalizedQueryTree();
129129
Supplier<NormalizedField> normalisedField = () -> normalizedQuery.get().getNormalizedField(sameFields, executionInfo.getObjectType(), executionInfo.getPath());
130130
DataFetchingFieldSelectionSet selectionSet = DataFetchingFieldSelectionSetImpl.newCollector(executionContext.getGraphQLSchema(), fieldType, normalisedField);
131131

src/main/java/graphql/normalized/NormalizedField.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public ImmutableMap<String, Object> getResolvedArguments() {
163163
}
164164

165165

166-
public static Builder newQueryExecutionField() {
166+
public static Builder newNormalizedField() {
167167
return new Builder();
168168
}
169169

src/main/java/graphql/normalized/NormalizedQueryTree.java renamed to src/main/java/graphql/normalized/NormalizedQuery.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313
import java.util.Map;
1414

1515
@Internal
16-
public class NormalizedQueryTree {
16+
public class NormalizedQuery {
1717

1818
private final List<NormalizedField> topLevelFields;
1919
private final ImmutableListMultimap<Field, NormalizedField> fieldToNormalizedField;
2020
private final Map<NormalizedField, MergedField> normalizedFieldToMergedField;
2121
private final ImmutableListMultimap<FieldCoordinates, NormalizedField> coordinatesToNormalizedFields;
2222

23-
public NormalizedQueryTree(List<NormalizedField> topLevelFields,
24-
ImmutableListMultimap<Field, NormalizedField> fieldToNormalizedField,
25-
Map<NormalizedField, MergedField> normalizedFieldToMergedField,
26-
ImmutableListMultimap<FieldCoordinates, NormalizedField> coordinatesToNormalizedFields) {
23+
public NormalizedQuery(List<NormalizedField> topLevelFields,
24+
ImmutableListMultimap<Field, NormalizedField> fieldToNormalizedField,
25+
Map<NormalizedField, MergedField> normalizedFieldToMergedField,
26+
ImmutableListMultimap<FieldCoordinates, NormalizedField> coordinatesToNormalizedFields) {
2727
this.topLevelFields = topLevelFields;
2828
this.fieldToNormalizedField = fieldToNormalizedField;
2929
this.normalizedFieldToMergedField = normalizedFieldToMergedField;

src/main/java/graphql/normalized/NormalizedQueryTreeFactory.java renamed to src/main/java/graphql/normalized/NormalizedQueryFactory.java

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -50,39 +50,39 @@
5050
import 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

Comments
 (0)