Beispiel #1
0
        public SelectionSet SelectionSet(GraphQLSelectionSet source)
        {
            var set = new SelectionSet().WithLocation(source, _body);

            source?.Selections.Apply(s =>
            {
                set.Add(Selection(s));
            });
            return(set);
        }
Beispiel #2
0
        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);
        }
Beispiel #4
0
        /// <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);
        }