Ejemplo n.º 1
0
 private void UnPackType(GraphQLType type, ValueTypeReference target)
 {
     try
     {
         if (type is GraphQLNonNullType nonNullType)
         {
             target.CanValueBeNull = true;
             UnPackType(nonNullType.Type, target);
         }
         else if (type is GraphQLListType listType)
         {
             target.IsCollection = true;
             if (target.CanValueBeNull)
             {
                 target.CanValueBeNull      = false;
                 target.CanCollectionBeNull = true;
             }
             UnPackType(listType.Type, target);
         }
         else if (type is GraphQLNamedType namedType)
         {
             target.Type = ResolveType(namedType);
         }
         else
         {
             throw new Exception("dunno???");
         }
     }catch (Exception ex)
     {
         throw;
     }
 }
Ejemplo n.º 2
0
        internal ValueTypeReference ResolveValueType(GraphQLType type)
        {
            var result = new ValueTypeReference();

            UnPackType(type, result);

            return(result);
        }
Ejemplo n.º 3
0
        internal ValueTypeReference ResolveValueType(ITypeNode type)
        {
            ValueTypeReference result = new ValueTypeReference();

            UnPackType(type, result);

            return(result);
        }
Ejemplo n.º 4
0
        public void Resolve(GraphQLDocument doc)
        {
            this.Type = doc.ResolveValueType(this.definition.Type);

            //if(this.definition.DefaultValue is ScalerValues sv)!!!
            //{
            //    this.DefaultValue = sv.Value;
            //}
            //else
            {
                this.DefaultValue = this.definition.DefaultValue?.ToString();
            }


            this.Type = doc.ResolveValueType(this.definition.Type);
        }
Ejemplo n.º 5
0
        public void Resolve(GraphQLDocument doc)
        {
            this.Type = doc.ResolveValueType(this.definition.Type);

            if (this.definition.DefaultValue is GraphQLParser.AST.GraphQLScalarValue sv)
            {
                this.DefaultValue = sv.Value;
            }
            else
            {
                this.DefaultValue = this.definition.DefaultValue?.ToString();
            }


            this.Type = doc.ResolveValueType(this.definition.Type);
        }
Ejemplo n.º 6
0
        public void Resolve(GraphQLDocument doc)
        {
            if (this.Name == "__typename")
            {
                return;
            }

            if (this.definition != null)
            {
                this.Type = doc.ResolveValueType(this.definition.Type);
            }
            else if (this.definitionInput != null)
            {
                this.Type = doc.ResolveValueType(this.definitionInput.Type);
            }

            foreach (Argument a in this.Arguments)
            {
                a.Resolve(doc);
            }
        }