mergeSelectionSets function

SelectionSetNode mergeSelectionSets(
  1. List<SelectionNode> fields
)

Implementation

SelectionSetNode mergeSelectionSets(List<SelectionNode> fields) {
  final selectionSet = <SelectionNode>[];

  for (final field in fields) {
    final fieldSelections = field.selectionSet?.selections;
    if (fieldSelections != null) {
      selectionSet.addAll(fieldSelections);
    }
  }

  return SelectionSetNode(selections: selectionSet);
}