Skip to content

Commit 053aac4

Browse files
committed
Merged in master
1 parent 95654b5 commit 053aac4

File tree

4 files changed

+6
-61
lines changed

4 files changed

+6
-61
lines changed

src/main/java/graphql/execution/Execution.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import graphql.schema.impl.SchemaUtil;
3232
import org.jspecify.annotations.NonNull;
3333
import graphql.util.FpKit;
34-
import org.jetbrains.annotations.NotNull;
3534
import org.reactivestreams.Publisher;
3635

3736
import java.util.Collections;
@@ -129,7 +128,7 @@ public CompletableFuture<ExecutionResult> execute(Document document, GraphQLSche
129128
return ValuesResolver.coerceVariableValues(graphQLSchema, variableDefinitions, inputVariables, executionInput.getGraphQLContext(), executionInput.getLocale());
130129
}
131130

132-
private static @NotNull Supplier<NormalizedVariables> normalizedVariableValues(GraphQLSchema graphQLSchema, ExecutionInput executionInput, NodeUtil.GetOperationResult getOperationResult) {
131+
private static @NonNull Supplier<NormalizedVariables> normalizedVariableValues(GraphQLSchema graphQLSchema, ExecutionInput executionInput, NodeUtil.GetOperationResult getOperationResult) {
133132
Supplier<NormalizedVariables> normalizedVariableValues;
134133
RawVariables inputVariables = executionInput.getRawVariables();
135134
List<VariableDefinition> variableDefinitions = getOperationResult.operationDefinition.getVariableDefinitions();

src/main/java/graphql/execution/directives/QueryDirectivesImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import graphql.schema.GraphQLDirective;
1919
import graphql.schema.GraphQLSchema;
2020
import graphql.util.LockKit;
21-
import org.jetbrains.annotations.Nullable;
2221

2322
import java.util.ArrayList;
2423
import java.util.LinkedHashMap;

src/main/java/graphql/normalized/ArgumentMaker.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
import graphql.language.ObjectField;
1313
import graphql.language.ObjectValue;
1414
import graphql.language.Value;
15-
import org.jetbrains.annotations.NotNull;
16-
import org.jetbrains.annotations.Nullable;
15+
import org.jspecify.annotations.NonNull;
16+
import org.jspecify.annotations.Nullable;
1717

1818
import java.util.List;
1919
import java.util.Map;
@@ -94,7 +94,7 @@ private static Value<?> argValue(ExecutableNormalizedField executableNormalizedF
9494
return (Value<?>) value;
9595
}
9696

97-
@NotNull
97+
@NonNull
9898
private static Value<?> argValue(ExecutableNormalizedField executableNormalizedField,
9999
QueryAppliedDirective queryAppliedDirective,
100100
String argName,

src/main/java/graphql/normalized/ExecutableNormalizedOperationToAstCompiler.java

Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ private static Field selectionForNormalizedField(GraphQLSchema schema,
389389
.build();
390390
}
391391

392-
private static @NotNull List<Directive> buildDirectives(ExecutableNormalizedField executableNormalizedField, QueryDirectives queryDirectives, VariableAccumulator variableAccumulator) {
392+
private static @NonNull List<Directive> buildDirectives(ExecutableNormalizedField executableNormalizedField, QueryDirectives queryDirectives, VariableAccumulator variableAccumulator) {
393393
if (queryDirectives == null || queryDirectives.getImmediateAppliedDirectivesByField().isEmpty()) {
394394
return emptyList();
395395
}
@@ -401,7 +401,7 @@ private static Field selectionForNormalizedField(GraphQLSchema schema,
401401

402402
private static Directive buildDirective(ExecutableNormalizedField executableNormalizedField, QueryDirectives queryDirectives, QueryAppliedDirective queryAppliedDirective, VariableAccumulator variableAccumulator) {
403403

404-
List<Argument> arguments = ArgumentMaker.createDirectiveArguments(executableNormalizedField,queryDirectives,queryAppliedDirective, variableAccumulator);
404+
List<Argument> arguments = ArgumentMaker.createDirectiveArguments(executableNormalizedField, queryDirectives, queryAppliedDirective, variableAccumulator);
405405
return Directive.newDirective()
406406
.name(queryAppliedDirective.getName())
407407
.arguments(arguments).build();
@@ -416,59 +416,6 @@ private static SelectionSet selectionSet(List<Field> fields) {
416416
return newSelectionSet().selections(fields).build();
417417
}
418418

419-
private static List<Argument> createArguments(ExecutableNormalizedField executableNormalizedField,
420-
VariableAccumulator variableAccumulator) {
421-
ImmutableList.Builder<Argument> result = ImmutableList.builder();
422-
ImmutableMap<String, NormalizedInputValue> normalizedArguments = executableNormalizedField.getNormalizedArguments();
423-
for (String argName : normalizedArguments.keySet()) {
424-
NormalizedInputValue normalizedInputValue = normalizedArguments.get(argName);
425-
Value<?> value = argValue(executableNormalizedField, argName, normalizedInputValue, variableAccumulator);
426-
Argument argument = newArgument()
427-
.name(argName)
428-
.value(value)
429-
.build();
430-
result.add(argument);
431-
}
432-
return result.build();
433-
}
434-
435-
@SuppressWarnings("unchecked")
436-
private static Value<?> argValue(ExecutableNormalizedField executableNormalizedField,
437-
String argName,
438-
@Nullable Object value,
439-
VariableAccumulator variableAccumulator) {
440-
if (value instanceof List) {
441-
ArrayValue.Builder arrayValue = ArrayValue.newArrayValue();
442-
arrayValue.values(map((List<Object>) value, val -> argValue(executableNormalizedField, argName, val, variableAccumulator)));
443-
return arrayValue.build();
444-
}
445-
if (value instanceof Map) {
446-
ObjectValue.Builder objectValue = ObjectValue.newObjectValue();
447-
Map<String, Object> map = (Map<String, Object>) value;
448-
for (String fieldName : map.keySet()) {
449-
Value<?> fieldValue = argValue(executableNormalizedField, argName, (NormalizedInputValue) map.get(fieldName), variableAccumulator);
450-
objectValue.objectField(ObjectField.newObjectField().name(fieldName).value(fieldValue).build());
451-
}
452-
return objectValue.build();
453-
}
454-
if (value == null) {
455-
return NullValue.newNullValue().build();
456-
}
457-
return (Value<?>) value;
458-
}
459-
460-
@NonNull
461-
private static Value<?> argValue(ExecutableNormalizedField executableNormalizedField,
462-
String argName,
463-
NormalizedInputValue normalizedInputValue,
464-
VariableAccumulator variableAccumulator) {
465-
if (variableAccumulator.shouldMakeVariable(executableNormalizedField, argName, normalizedInputValue)) {
466-
VariableValueWithDefinition variableWithDefinition = variableAccumulator.accumulateVariable(normalizedInputValue);
467-
return variableWithDefinition.getVariableReference();
468-
} else {
469-
return argValue(executableNormalizedField, argName, normalizedInputValue.getValue(), variableAccumulator);
470-
}
471-
}
472419

473420
@NonNull
474421
private static GraphQLFieldDefinition getFieldDefinition(GraphQLSchema schema,

0 commit comments

Comments
 (0)