@@ -389,7 +389,7 @@ private static Field selectionForNormalizedField(GraphQLSchema schema,
389
389
.build ();
390
390
}
391
391
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 ) {
393
393
if (queryDirectives == null || queryDirectives .getImmediateAppliedDirectivesByField ().isEmpty ()) {
394
394
return emptyList ();
395
395
}
@@ -401,7 +401,7 @@ private static Field selectionForNormalizedField(GraphQLSchema schema,
401
401
402
402
private static Directive buildDirective (ExecutableNormalizedField executableNormalizedField , QueryDirectives queryDirectives , QueryAppliedDirective queryAppliedDirective , VariableAccumulator variableAccumulator ) {
403
403
404
- List <Argument > arguments = ArgumentMaker .createDirectiveArguments (executableNormalizedField ,queryDirectives ,queryAppliedDirective , variableAccumulator );
404
+ List <Argument > arguments = ArgumentMaker .createDirectiveArguments (executableNormalizedField , queryDirectives , queryAppliedDirective , variableAccumulator );
405
405
return Directive .newDirective ()
406
406
.name (queryAppliedDirective .getName ())
407
407
.arguments (arguments ).build ();
@@ -416,59 +416,6 @@ private static SelectionSet selectionSet(List<Field> fields) {
416
416
return newSelectionSet ().selections (fields ).build ();
417
417
}
418
418
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
- }
472
419
473
420
@ NonNull
474
421
private static GraphQLFieldDefinition getFieldDefinition (GraphQLSchema schema ,
0 commit comments