3030import graphql .language .SelectionSet ;
3131import graphql .language .TypeName ;
3232import graphql .language .VariableDefinition ;
33- import graphql .normalized .incremental .DeferExecution ;
33+ import graphql .normalized .incremental .NormalizedDeferredExecution ;
3434import graphql .normalized .incremental .IncrementalNodes ;
3535import graphql .schema .FieldCoordinates ;
3636import graphql .schema .GraphQLCompositeType ;
@@ -568,7 +568,7 @@ private void createNFs(ImmutableList.Builder<ExecutableNormalizedField> nfListBu
568568 nfListBuilder .add (nf );
569569
570570 if (this .options .deferSupport ) {
571- nf .addDeferExecutions (fieldGroup .deferExecutions );
571+ nf .addDeferredExecutions (fieldGroup .deferredExecutions );
572572 }
573573 }
574574 if (commonParentsGroups .size () > 1 ) {
@@ -633,22 +633,22 @@ private List<CollectedFieldGroup> groupByCommonParentsNoDeferSupport(Collection<
633633
634634 private List <CollectedFieldGroup > groupByCommonParentsWithDeferSupport (Collection <CollectedField > fields ) {
635635 ImmutableSet .Builder <GraphQLObjectType > objectTypes = ImmutableSet .builder ();
636- ImmutableSet .Builder <DeferExecution > deferExecutionsBuilder = ImmutableSet .builder ();
636+ ImmutableSet .Builder <NormalizedDeferredExecution > deferredExecutionsBuilder = ImmutableSet .builder ();
637637
638638 for (CollectedField collectedField : fields ) {
639639 objectTypes .addAll (collectedField .objectTypes );
640640
641- DeferExecution collectedDeferExecution = collectedField .deferExecution ;
641+ NormalizedDeferredExecution collectedDeferredExecution = collectedField .deferredExecution ;
642642
643- if (collectedDeferExecution != null ) {
644- deferExecutionsBuilder .add (collectedDeferExecution );
643+ if (collectedDeferredExecution != null ) {
644+ deferredExecutionsBuilder .add (collectedDeferredExecution );
645645 }
646646 }
647647
648648 Set <GraphQLObjectType > allRelevantObjects = objectTypes .build ();
649- Set <DeferExecution > deferExecutions = deferExecutionsBuilder .build ();
649+ Set <NormalizedDeferredExecution > deferredExecutions = deferredExecutionsBuilder .build ();
650650
651- Set <String > duplicatedLabels = listDuplicatedLabels (deferExecutions );
651+ Set <String > duplicatedLabels = listDuplicatedLabels (deferredExecutions );
652652
653653 if (!duplicatedLabels .isEmpty ()) {
654654 // Query validation should pick this up
@@ -657,33 +657,33 @@ private List<CollectedFieldGroup> groupByCommonParentsWithDeferSupport(Collectio
657657
658658 Map <GraphQLType , ImmutableList <CollectedField >> groupByAstParent = groupingBy (fields , fieldAndType -> fieldAndType .astTypeCondition );
659659 if (groupByAstParent .size () == 1 ) {
660- return singletonList (new CollectedFieldGroup (ImmutableSet .copyOf (fields ), allRelevantObjects , deferExecutions ));
660+ return singletonList (new CollectedFieldGroup (ImmutableSet .copyOf (fields ), allRelevantObjects , deferredExecutions ));
661661 }
662662
663663 ImmutableList .Builder <CollectedFieldGroup > result = ImmutableList .builder ();
664664 for (GraphQLObjectType objectType : allRelevantObjects ) {
665665 Set <CollectedField > relevantFields = filterSet (fields , field -> field .objectTypes .contains (objectType ));
666666
667- Set <DeferExecution > filteredDeferExecutions = deferExecutions .stream ()
667+ Set <NormalizedDeferredExecution > filteredDeferredExecutions = deferredExecutions .stream ()
668668 .filter (filterExecutionsFromType (objectType ))
669669 .collect (toCollection (LinkedHashSet ::new ));
670670
671- result .add (new CollectedFieldGroup (relevantFields , singleton (objectType ), filteredDeferExecutions ));
671+ result .add (new CollectedFieldGroup (relevantFields , singleton (objectType ), filteredDeferredExecutions ));
672672 }
673673 return result .build ();
674674 }
675675
676- private static Predicate <DeferExecution > filterExecutionsFromType (GraphQLObjectType objectType ) {
676+ private static Predicate <NormalizedDeferredExecution > filterExecutionsFromType (GraphQLObjectType objectType ) {
677677 String objectTypeName = objectType .getName ();
678- return deferExecution -> deferExecution .getPossibleTypes ()
678+ return deferredExecution -> deferredExecution .getPossibleTypes ()
679679 .stream ()
680680 .map (GraphQLObjectType ::getName )
681681 .anyMatch (objectTypeName ::equals );
682682 }
683683
684- private Set <String > listDuplicatedLabels (Collection <DeferExecution > deferExecutions ) {
685- return deferExecutions .stream ()
686- .map (DeferExecution ::getLabel )
684+ private Set <String > listDuplicatedLabels (Collection <NormalizedDeferredExecution > deferredExecutions ) {
685+ return deferredExecutions .stream ()
686+ .map (NormalizedDeferredExecution ::getLabel )
687687 .filter (Objects ::nonNull )
688688 .collect (Collectors .groupingBy (Function .identity (), Collectors .counting ()))
689689 .entrySet ()
@@ -697,11 +697,11 @@ private void collectFromSelectionSet(SelectionSet selectionSet,
697697 List <CollectedField > result ,
698698 GraphQLCompositeType astTypeCondition ,
699699 Set <GraphQLObjectType > possibleObjects ,
700- DeferExecution deferExecution
700+ NormalizedDeferredExecution deferredExecution
701701 ) {
702702 for (Selection <?> selection : selectionSet .getSelections ()) {
703703 if (selection instanceof Field ) {
704- collectField (result , (Field ) selection , possibleObjects , astTypeCondition , deferExecution );
704+ collectField (result , (Field ) selection , possibleObjects , astTypeCondition , deferredExecution );
705705 } else if (selection instanceof InlineFragment ) {
706706 collectInlineFragment (result , (InlineFragment ) selection , possibleObjects , astTypeCondition );
707707 } else if (selection instanceof FragmentSpread ) {
@@ -731,12 +731,12 @@ private void collectFragmentSpread(List<CollectedField> result,
731731 GraphQLCompositeType newAstTypeCondition = (GraphQLCompositeType ) assertNotNull (this .graphQLSchema .getType (fragmentDefinition .getTypeCondition ().getName ()));
732732 Set <GraphQLObjectType > newPossibleObjects = narrowDownPossibleObjects (possibleObjects , newAstTypeCondition );
733733
734- DeferExecution newDeferExecution = buildDeferExecution (
734+ NormalizedDeferredExecution newDeferredExecution = buildDeferredExecution (
735735 fragmentSpread .getDirectives (),
736736 fragmentDefinition .getTypeCondition (),
737737 newPossibleObjects );
738738
739- collectFromSelectionSet (fragmentDefinition .getSelectionSet (), result , newAstTypeCondition , newPossibleObjects , newDeferExecution );
739+ collectFromSelectionSet (fragmentDefinition .getSelectionSet (), result , newAstTypeCondition , newPossibleObjects , newDeferredExecution );
740740 }
741741
742742 private void collectInlineFragment (List <CollectedField > result ,
@@ -756,16 +756,16 @@ private void collectInlineFragment(List<CollectedField> result,
756756
757757 }
758758
759- DeferExecution newDeferExecution = buildDeferExecution (
759+ NormalizedDeferredExecution newDeferredExecution = buildDeferredExecution (
760760 inlineFragment .getDirectives (),
761761 inlineFragment .getTypeCondition (),
762762 newPossibleObjects
763763 );
764764
765- collectFromSelectionSet (inlineFragment .getSelectionSet (), result , newAstTypeCondition , newPossibleObjects , newDeferExecution );
765+ collectFromSelectionSet (inlineFragment .getSelectionSet (), result , newAstTypeCondition , newPossibleObjects , newDeferredExecution );
766766 }
767767
768- private DeferExecution buildDeferExecution (
768+ private NormalizedDeferredExecution buildDeferredExecution (
769769 List <Directive > directives ,
770770 TypeName typeCondition ,
771771 Set <GraphQLObjectType > newPossibleObjects ) {
@@ -785,7 +785,7 @@ private void collectField(List<CollectedField> result,
785785 Field field ,
786786 Set <GraphQLObjectType > possibleObjectTypes ,
787787 GraphQLCompositeType astTypeCondition ,
788- DeferExecution deferExecution
788+ NormalizedDeferredExecution deferredExecution
789789 ) {
790790 if (!conditionalNodes .shouldInclude (field ,
791791 this .coercedVariableValues .toMap (),
@@ -797,7 +797,7 @@ private void collectField(List<CollectedField> result,
797797 if (possibleObjectTypes .isEmpty ()) {
798798 return ;
799799 }
800- result .add (new CollectedField (field , possibleObjectTypes , astTypeCondition , deferExecution ));
800+ result .add (new CollectedField (field , possibleObjectTypes , astTypeCondition , deferredExecution ));
801801 }
802802
803803 private Set <GraphQLObjectType > narrowDownPossibleObjects (Set <GraphQLObjectType > currentOnes ,
@@ -852,13 +852,13 @@ private static class CollectedField {
852852 Field field ;
853853 Set <GraphQLObjectType > objectTypes ;
854854 GraphQLCompositeType astTypeCondition ;
855- DeferExecution deferExecution ;
855+ NormalizedDeferredExecution deferredExecution ;
856856
857- public CollectedField (Field field , Set <GraphQLObjectType > objectTypes , GraphQLCompositeType astTypeCondition , DeferExecution deferExecution ) {
857+ public CollectedField (Field field , Set <GraphQLObjectType > objectTypes , GraphQLCompositeType astTypeCondition , NormalizedDeferredExecution deferredExecution ) {
858858 this .field = field ;
859859 this .objectTypes = objectTypes ;
860860 this .astTypeCondition = astTypeCondition ;
861- this .deferExecution = deferExecution ;
861+ this .deferredExecution = deferredExecution ;
862862 }
863863 }
864864
@@ -885,12 +885,12 @@ private FieldAndAstParent(Field field, GraphQLCompositeType astParentType) {
885885 private static class CollectedFieldGroup {
886886 Set <GraphQLObjectType > objectTypes ;
887887 Set <CollectedField > fields ;
888- Set <DeferExecution > deferExecutions ;
888+ Set <NormalizedDeferredExecution > deferredExecutions ;
889889
890- public CollectedFieldGroup (Set <CollectedField > fields , Set <GraphQLObjectType > objectTypes , Set <DeferExecution > deferExecutions ) {
890+ public CollectedFieldGroup (Set <CollectedField > fields , Set <GraphQLObjectType > objectTypes , Set <NormalizedDeferredExecution > deferredExecutions ) {
891891 this .fields = fields ;
892892 this .objectTypes = objectTypes ;
893- this .deferExecutions = deferExecutions ;
893+ this .deferredExecutions = deferredExecutions ;
894894 }
895895 }
896896 }
0 commit comments