Exemple #1
0
        public override object VisitArguments(GraphQLSchemaParser.ArgumentsContext context)
        {
            var args = new List <Arg>();

            if (context != null)
            {
                foreach (var arg in context.argument())
                {
                    var type      = arg.dataType().type?.Text;
                    var arrayType = arg.dataType().arrayType?.Text;
                    args.Add(new Arg(this.schemaInfo)
                    {
                        Name     = arg.NAME().GetText(),
                        TypeName = arrayType ?? type,
                        Required = (arg.dataType().arrayRequired ?? arg.dataType().required) != null,
                        IsArray  = arrayType != null
                    });
                }
            }
            return(args);
        }
Exemple #2
0
        public override object VisitArguments(GraphQLSchemaParser.ArgumentsContext context)
        {
            var args = new List <Arg>();

            if (context != null)
            {
                foreach (var arg in context.argument())
                {
                    var type    = arg.dataType().GetText();
                    var isArray = type[0] == '[';
                    type = type.Trim('[', ']');
                    args.Add(new Arg(this.schemaInfo)
                    {
                        Name     = arg.NAME().GetText(),
                        TypeName = type,
                        Required = arg.required != null,
                        IsArray  = isArray
                    });
                }
            }
            return(args);
        }