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
Modifier and TypeMethodDescriptionbooleanReturnstrueif the selection set contains the field identified byqualifiedName.@Nullable SelectedFieldReturns the fields identified byqualifiedNameornull.@NotNull List<SelectedField>Returns a list of the immediate fields in the selection.
-
Method Details
-
getFields
Returns a list of the immediate fields in the selection.- Returns:
- the immediate list of fields in the selection.
-
contains
Returnstrueif 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
Returns the fields identified byqualifiedNameornull.- Parameters:
qualifiedName- the qualified name of the field- Returns:
- the
SelectedFieldfor the passedqualifiedNameornull
-