Package graphql.schema.idl
Class SchemaParseOrder
java.lang.Object
graphql.schema.idl.SchemaParseOrder
- All Implemented Interfaces:
Serializable
This class will track what order
SDLDefinition
were parsed in
via SchemaParser
and TypeDefinitionRegistry
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends SDLDefinition<?>>
SchemaParseOrderaddDefinition
(T sdlDefinition) This adds a newSDLDefinition
to the order<T extends GraphQLSchemaElement>
Comparator<? super T> This comparator will sort according to the original parsed orderMap
<String, List<SDLNamedDefinition<?>>> This map is the order in whichSDLDefinition
s were parsed per uniqueSourceLocation.getSourceName()
and it only containsSDLNamedDefinition
s.Map
<String, List<SDLDefinition<?>>> This map is the order in whichSDLDefinition
s were parsed per uniqueSourceLocation.getSourceName()
.<T extends SDLDefinition<?>>
SchemaParseOrderremoveDefinition
(T sdlDefinition) This removes aSDLDefinition
from the ordertoString()
-
Constructor Details
-
SchemaParseOrder
public SchemaParseOrder()
-
-
Method Details
-
getInOrder
This map is the order in whichSDLDefinition
s were parsed per uniqueSourceLocation.getSourceName()
. If there is no source then the empty string "" is used.- Returns:
- a map of source names to definitions in parsed order
-
getInNameOrder
This map is the order in whichSDLDefinition
s were parsed per uniqueSourceLocation.getSourceName()
and it only containsSDLNamedDefinition
s. If there is no source then the empty string "" is used.- Returns:
- a map of source names to definitions in parsed order
-
getElementComparator
This comparator will sort according to the original parsed order- Type Parameters:
T
- is aGraphQLSchemaElement
- Returns:
- a comparator that sorts schema elements in parsed order
-
addDefinition
This adds a newSDLDefinition
to the order- Type Parameters:
T
- for two- Parameters:
sdlDefinition
- the SDL definition to add- Returns:
- this
SchemaParseOrder
for fluent building
-
removeDefinition
This removes aSDLDefinition
from the order- Type Parameters:
T
- for two- Parameters:
sdlDefinition
- the SDL definition to remove- Returns:
- this
SchemaParseOrder
for fluent building
-
toString
-