Add the transform feature to related selectors
satanTime opened this issue · comments
satanTime commented
The goal is to have possibility to convert entities on all levels.
nbitouze commented
I'm also interested in this. Has any progress been made?
I've implemented a mediocre solution with two large downsides:
- I didn't make an effort to add multiple signatures to
relatedEntity
andrelatedEntitySelector
with the newtransformer
option. I defined an additionalrelatedEntityWithTransformer
with its matchingrelatedEntitySelectorWithTransformer
. They are typed with an additional type parameterTRANSFORMED_RELATED_ENTITY
, some occurrences ofRELATED_ENTITY
in the type definitions have been replaced withTRANSFORMED_RELATED_ENTITY
. Once everything works, it would be much better to have a unique function to call, but I'm not sure what's the best design for this. - It works well for one level of relations, but not for nested relations. I think this has to do with the caching process in
relatedEntity
's callback, which I probably don't exploit adequately.
I've also tried something similar with childrenEntities
.
I'm not happy with my current solutions but I'm of course willing to share them, especially if that helps with the development of a better alternative.