Exemplo n.º 1
0
        public VariableDefinitions VariableDefinitions(IEnumerable <GraphQLVariableDefinition> source)
        {
            var defs = new VariableDefinitions();
            var list = source?.Select(VariableDefinition);

            list?.Apply(defs.Add);
            return(defs);
        }
Exemplo n.º 2
0
        public override object VisitVariableDefinitions(GraphQLParser.VariableDefinitionsContext context)
        {
            var variables = new VariableDefinitions();

            context.variableDefinition().Apply(childContext =>
            {
                var variable = Visit(childContext) as VariableDefinition;
                variables.Add(variable);
            });

            return(variables);
        }
        public VariableDefinitions VariableDefinitions(IEnumerable <GraphQLVariableDefinition> source)
        {
            var defs = new VariableDefinitions();

            if (source != null)
            {
                foreach (var def in source.Select(VariableDefinition))
                {
                    defs.Add(def);
                }
            }
            return(defs);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Converts a list of variable definition nodes and their children.
        /// </summary>
        private static VariableDefinitions VariableDefinitions(List <GraphQLVariableDefinition> source)
        {
            VariableDefinitions defs = null;

            if (source?.Count > 0)
            {
                defs = new VariableDefinitions(source.Count);
                foreach (var def in source)
                {
                    defs.Add(VariableDefinition(def));
                }
            }

            return(defs);
        }
Exemplo n.º 5
0
 public Operation()
 {
     OperationType = OperationType.Query;
     Directives    = new Directives();
     Variables     = new VariableDefinitions();
 }