public SelectionSet SelectionSet(GraphQLSelectionSet source) { var set = new SelectionSet().WithLocation(source, _body); source?.Selections.Apply(s => { set.Add(Selection(s)); }); return(set); }
public override object VisitSelectionSet(GraphQLParser.SelectionSetContext context) { var selections = new SelectionSet(); NewNode(selections, context); foreach (var selectionContext in context.selection()) { var selection = Visit(selectionContext) as ISelection; selections.Add(selection); } return(selections); }
public SelectionSet SelectionSet(GraphQLSelectionSet source) { var set = new SelectionSet().WithLocation(source, _body); if (source != null) { foreach (var s in source.Selections) { set.Add(Selection(s)); } } return(set); }
/// <summary> /// Converts a selection set node and its children. /// </summary> private static SelectionSet SelectionSet(GraphQLSelectionSet source) { var set = new SelectionSet(); if (source != null) { set.SourceLocation = Convert(source.Location); foreach (var s in source.Selections) { set.Add(Selection(s)); } } return(set); }