jazz
jazz copied to clipboard
Resolve: add a way to request a n-levels deep load
Some of our adopters have very complex CoValue schema shapes, which makes very hard to define by hand all the props to resolve.
It would quite useful to be able to specify "load the entire CoValue dependencies all at once" to skip the manual declaration process when that's the main goal.
API-wise I'm thinking about something like this:
const { me } = useAccount(MusicaAccount, {
resolve: { root: { rootPlaylist: { $deepLoad: true }, playlists: true } },
});
With this resolve everything inside the rootPlaylist will be deeply loaded
Edge cases:
- Circular dependencies should be handled by reusing the same refs (should be doable)
- FileStream and CoFeed types should be skipped
- Do we need a depth level cap?
This would be a necessary implementation for any tree-like data structure especially if you are trying to display the whole tree.