Closed iocron closed 1 year ago
I do have the same issue
I was gonna report this issue as well, it just goes into a loop and populate the data again and again which increases the size of the fetched data.
Thanks for reporting! For the moment I won't look into this myself. If anyone wanna have a go at solving the issue im happy to review a PR and make a new release
@Barelydead I created a fix for that, but I'm not sure if it works all the time. Nevertheless it helped at our project
@ChrisKru97 your changes works, updated this manually from node modules and it works smoothly, thanks
Fix merged to v3.0.0
When 1:n, n:1, n:n relations are involved, the plugin populates everything self-recursively (we haven't tested other scenarios yet). For Example, a collection of cities and stations, when a city has multiple stations, and the station belongs to one city, then the plugin populates as deep as it can in both directions (default 5). Meaning the result (simplified) will look something similar to the example below. Instead the recursion should stop, once it tries to recurse into itself, meaning the recursion of a property / data should stop once it has already been recursed. I hope I am explaining it somewhat understandable. As far as I am aware, in real world examples there is (most of the time) no need to recurse / populate any further, once the final relation has been hit. +The depth functionality (default 5) might not be required anymore (or just as a hard fallback if everything goes wrong) and could be used optionally only if really needed. Maybe I am missing something, then let me know. Thanks for the great plugin, we are already using it, and we are only missing this one critical implementation to use it in production :) 👍