示例#1
0
 public virtual GraphQLObjectField BeginVisitObjectField(
     GraphQLObjectField node)
 {
     BeginVisitNode(node.Name);
     BeginVisitNode(node.Value);
     return(node);
 }
示例#2
0
        private string PrintObjectField(GraphQLObjectField node)
        {
            var name  = PrintName(node.Name);
            var value = Print(node.Value);

            return($"{name}: {value}");
        }
        private Result GetValueFromField(
            ISchemaRepository schemaRepository,
            GraphQLFieldInfo field,
            GraphQLObjectField astField)
        {
            var graphQLType = schemaRepository.GetSchemaInputTypeFor(field.SystemType);
            var result      = graphQLType.GetFromAst(astField?.Value, schemaRepository);

            return(result);
        }
示例#4
0
        public override GraphQLObjectField BeginVisitObjectField(
            GraphQLObjectField node)
        {
            {
                Tracker.EnterObjectField?.Invoke(node);
            }

            var _ = base.BeginVisitObjectField(node);


            {
                Tracker.LeaveObjectField?.Invoke(node);
            }

            return(_);
        }
示例#5
0
        public override GraphQLObjectField BeginVisitObjectField(GraphQLObjectField node)
        {
            var fieldName = node.Name.Value;

            if (this.knownNames.ContainsKey(fieldName))
            {
                this.Errors.Add(new GraphQLException(this.DuplicateInputFieldMessage(fieldName),
                                                     new[] { this.knownNames[fieldName], node.Name }));
            }
            else
            {
                this.knownNames.Add(fieldName, node.Name);
            }

            return(base.BeginVisitObjectField(node));
        }
示例#6
0
        public override GraphQLObjectField BeginVisitObjectField(GraphQLObjectField node)
        {
            var field = (this.GetLastField()
                         ?.GetGraphQLType(this.SchemaRepository) as GraphQLComplexType)
                        ?.GetFieldInfo(node.Name.Value);

            if (field != null)
            {
                var type = this.SchemaRepository.GetSchemaInputTypeFor(field.SystemType);
                this.inputTypeStack.Push(type);

                node = base.BeginVisitObjectField(node);
                this.inputTypeStack.Pop();

                return(node);
            }

            return(base.BeginVisitObjectField(node));
        }
 public ObjectField ObjectField(GraphQLObjectField source)
 {
     return(new ObjectField(Name(source.Name), Value(source.Value)).WithLocation(source, _body));
 }
 /// <summary>
 /// Initializes a new instance with the specified properties.
 /// </summary>
 public UniqueInputFieldNamesError(ValidationContext context, GraphQLValue node, GraphQLObjectField altNode)
     : base(context.Document.Source, NUMBER, DuplicateInputField(altNode.Name.StringValue), node, altNode.Value)
 {
 }
 private Result GetField(GraphQLObjectField astField, GraphQLInputObjectTypeFieldInfo fieldInfo, ISchemaRepository schemaRepository)
 {
     return(this.GetValueFromField(schemaRepository, fieldInfo, astField));
 }