Пример #1
0
        private static FieldNode CreateSelection(
            FieldNode previous,
            SelectionPathComponent next)
        {
            var selectionSet = new SelectionSetNode(
                null,
                new List <ISelectionNode> {
                previous
            });

            return(CreateSelection(selectionSet, next, null));
        }
Пример #2
0
        private static FieldNode CreateSelection(
            SelectionSetNode selectionSet,
            SelectionPathComponent next,
            string alias)
        {
            NameNode aliasNode = string.IsNullOrEmpty(alias)
                ? null : new NameNode(alias);

            return(new FieldNode
                   (
                       null,
                       next.Name,
                       aliasNode,
                       Array.Empty <DirectiveNode>(),
                       RewriteVariableNames(next.Arguments).ToList(),
                       selectionSet
                   ));
        }