angular2-jsonapi icon indicating copy to clipboard operation
angular2-jsonapi copied to clipboard

Getting RelationId without include

Open Mojo1 opened this issue 7 years ago • 1 comments

How to get the ID of a relation which is not included? As far as i can see it's not possible but should be possible

Mojo1 avatar Feb 26 '18 15:02 Mojo1

I'd like to bump this issue up. We are using this library to develop an application for Columbia employees, and encountered the same problem.

I agree that this should be possible, since per JSON API spec, the type and id of the relationship already exist in the response. However, angular2-jsonapi - or more specifically the JsonApiModel object - does not yet provide a convenient way to access the relationship data in the response body.

We are working around this by using the ?include= query parameter to include additional data. However, this workaround has performance implications, since it essentially forces us to send additional requests to the backend server, when the relationship data in the first request's response body has all the data we need.

Is there any way a library maintainer can address this issue? Or, if maintainers are busy, should we propose a fix and submit a pull request? It looks like there are enough thumbs ups here to get consensus on an acceptable solution.

lcary avatar Jun 13 '18 21:06 lcary