I don't think there is something like what you are looking for but the attributes plugin could be a good start. It converts nested objects into model trees (this would already solve your problem if you could get your backend to recursively fetch all the data right away). A relational plugin could have a similar API than the attributes plugin. You will need to somehow store all the models already retrieved, then set up your relations and go through the attributes and look each model instance up in that store.
↧