Description
Hello!
From the documentation, it appears the relationship-loading strategy is to use include
to return relationships with the primary payload. This certainly works, but can be a bit heavy.
Any thoughts on using a lazy-load approach to load relationships when needed?
Background
I've used Ember quite extensively and Ember Data in particular allows you to mark relationships as async. For example, if you have a Post
model with a Comment
relationship, fetching a Post
would include all of the Comment
ids associated with that Post
, but not embed the records themselves. Then when referencing the Post
's Comment
in a template, it would by dynamically fetched and added to the local store.
This has some advantages in that relationships are only loaded when needed, cuts down on payload size, and allows you to potentially apply difference cache policies per model.