private void VisitValue( IInputType type, object obj, Action <object> setValue, ISet <object> processed) { if (obj is null) { setValue(null); } else if (type.IsListType()) { VisitList( (ListType)type.ListType(), obj, setValue, processed); } else if (type.IsLeafType()) { VisitLeaf( (INamedInputType)type.NamedType(), obj, setValue, processed); } else if (type.IsInputObjectType()) { VisitInputObject( (InputObjectType)type.NamedType(), obj, setValue, processed); } else { throw new NotSupportedException(); } }
private object DeserializeValue(IInputType type, object value) { if (value is IDictionary <string, object> || value is IList <object> ) { return(_inputTypeConverter.Convert(value, type)); } else if (type.IsLeafType() && type.NamedType() is ISerializableType serializable && serializable.TryDeserialize(value, out object deserialized)) { return(deserialized); } return(value); }