Discussions
How to Properly Handle Relations with js-data in a Nested Fetch?
Hi all,
I'm working on a project using js-data and I'm trying to fetch a resource along with its related entities (e.g., users with their associated posts and comments). I’m a bit confused about the best way to structure this fetch so that all relationships are properly loaded and mapped.
Here’s what I’ve tried so far using findAll with with options, but I’m not sure if I’m nesting things correctly or if I need to define relations differently in the resource definitions.
What’s the recommended way to fetch deeply nested relations?
Should I be chaining separate calls instead of using a single findAll?
Are there any performance concerns I should be aware of?
Would really appreciate any examples or guidance on best practices for handling this kind of nested data in js-data. Thanks!
