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; } }
internal ValueTypeReference ResolveValueType(GraphQLType type) { var result = new ValueTypeReference(); UnPackType(type, result); return(result); }
internal ValueTypeReference ResolveValueType(ITypeNode type) { ValueTypeReference result = new ValueTypeReference(); UnPackType(type, result); return(result); }
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); }
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); }
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); } }