8000 Add Support for Relations without Data so that `loadRelations` can be used to load this data via stored related link · Issue #25 · BlairAllegroTech/js-data-jsonapi · GitHub
[go: up one dir, main page]

Skip to content
Add Support for Relations without Data so that loadRelations can be used to load this data via stored related link #25
@rgant

Description

@rgant

In my application we don't always include the relationship data with the primary data object. This causes a problem when I later try to load the related data using DS.loadRelations as it doesn't know what the links are.

The issue is around the test for hasData in JsonApiSerializer.ts. I believe there are two issues here:

  1. Relationships don't always include data key, but we should still add the links to the JSONAPI_META.relationships.
  2. Relationships that are null or an empty array are still valid. For example a User could have a null profile picture before they've added one, and the User might have an empty list of comments because they haven't made any yet.

I've created a branch on my fork to support my work trying to address this issue. If you have any suggestions then I would be happy to discuss. I'll submit a pull request when I have something.

Metadata

Metadata

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0