Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the transform feature to related selectors #1507

Open
satanTime opened this issue May 22, 2022 · 1 comment
Open

Add the transform feature to related selectors #1507

satanTime opened this issue May 22, 2022 · 1 comment

Comments

@satanTime
Copy link
Owner

The goal is to have possibility to convert entities on all levels.

@nbitouze
Copy link

nbitouze commented May 29, 2023

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 and relatedEntitySelector with the new transformer option. I defined an additional relatedEntityWithTransformer with its matching relatedEntitySelectorWithTransformer. They are typed with an additional type parameter TRANSFORMED_RELATED_ENTITY, some occurrences of RELATED_ENTITY in the type definitions have been replaced with TRANSFORMED_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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants