public FieldCollectionResult CollectFields( INamedOutputType type, SelectionSetNode selectionSet, Path path) { if (type == null) { throw new ArgumentNullException(nameof(type)); } if (selectionSet == null) { throw new ArgumentNullException(nameof(selectionSet)); } var fields = new OrderedDictionary <string, FieldSelection>(); var root = new FragmentNode(); CollectFields(type, selectionSet, path, fields, root); return(new FieldCollectionResult( type, selectionSet, fields.Values.ToList(), root.Children)); }
public FragmentNode AddChild(Fragment fragment) { var child = new FragmentNode(fragment); Children.Add(child); return(child); }
private void ResolveFields( INamedOutputType type, ISelectionNode selection, Path path, IDictionary <string, FieldSelection> fields, FragmentNode parent) { if (selection is FieldNode fs && type is IComplexOutputType ct) { ResolveFieldSelection( ct, fs, path, fields); }
private void CollectFields( INamedOutputType type, SelectionSetNode selectionSet, Path path, IDictionary <string, FieldSelection> fields, FragmentNode parent) { foreach (ISelectionNode selection in selectionSet.Selections) { ResolveFields( type, selection, path, fields, parent); } }