Package graphql.language
Class AstSorter
java.lang.Object
graphql.language.AstSorter
A class that helps you sort AST nodes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate <T,
U extends Comparable<? super U>>
Comparator<T> private Comparator
<Definition> private Comparator
<Selection> private Comparator
<Type> private <T> List
<T> sort
(List<T> items, Comparator<T> comparing) <T extends Node>
Tsort
(T nodeToBeSorted) This will sort nodes in specific orders and then alphabetically.private SelectionSet
sortSelectionSet
(SelectionSet selectionSet)
-
Constructor Details
-
AstSorter
public AstSorter()
-
-
Method Details
-
sort
This will sort nodes in specific orders and then alphabetically. The order is :- Query operation definitions
- Mutation operation definitions
- Subscriptions operation definitions
- Fragment definitions
- Directive definitions
- Schema definitions
- Object Type definitions
- Interface Type definitions
- Union Type definitions
- Enum Type definitions
- Scalar Type definitions
- Input Object Type definitions
-
comparingTypes
-
comparingSelections
-
comparingDefinitions
-
sortSelectionSet
-
sort
-
comparing
private <T,U extends Comparable<? super U>> Comparator<T> comparing(Function<? super T, ? extends U> keyExtractor)
-