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 Type
Method
Description
`boolean`
`contains(String qualifiedName)`
Returns `true` if the selection set contains the field identified by `qualifiedName`.
`@Nullable SelectedField`
`get(String qualifiedName)`
Returns the fields identified by `qualifiedName` or `null`.
`@NotNull List<SelectedField>`
`getFields()`
Returns a list of the immediate fields in the selection.

## Method Details

### 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)
Returns `true` if the selection set contains the field identified by `qualifiedName`.

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 by `qualifiedName` or `null`.

Parameters:
  `qualifiedName` - the qualified name of the field
Returns:
  the `SelectedField` for the passed `qualifiedName` or `null`