Package org.apache.sling.graphql.api
Interface SelectionSet
-
@ProviderType public interface SelectionSet
Interface to wrap information from GraphQL DataFetchingFieldSelectionSet.Mainly it keeps information about fields name that got selected.
For example:
queryName { field1 field2 { ... on Type1 { field3 } } field4 field5 { field6 field7 { field8 } } }
Would result in a mapping with corresponding SelectedField(s).
field1 would be accessible with qualified name "field1" while field3 would be accessible with qualified name "field2/Type1/field3" and field8 would be accessible with qualified name "field5/field7/field8"
Type1 would be a SelectedField with isInline() returning true
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
contains(String qualifiedName)
Returnstrue
if the selection set contains the field identified byqualifiedName
.@Nullable SelectedField
get(String qualifiedName)
Returns the fields identified byqualifiedName
ornull
.@NotNull List<SelectedField>
getFields()
Returns a list of the immediate fields in the selection.
-
-
-
Method Detail
-
getFields
@NotNull @NotNull List<SelectedField> getFields()
Returns a list of the immediate fields in the selection.- Returns:
- the immediate list of fields in the selection.
-
contains
boolean contains(String qualifiedName)
Returnstrue
if the selection set contains the field identified byqualifiedName
.- Parameters:
qualifiedName
- the qualified name of the field- Returns:
- true if the field qualified name exist.
-
get
@Nullable @Nullable SelectedField get(String qualifiedName)
Returns the fields identified byqualifiedName
ornull
.- Parameters:
qualifiedName
- the qualified name of the field- Returns:
- the
SelectedField
for the passedqualifiedName
ornull
-
-