Skip to content

lazy-load relationships? #103

Open
Open
@jamesdixon

Description

@jamesdixon

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions