Closed eiktyrner closed 7 years ago
@eiktyrner, thank you for the feedback. Before diving into the implementation, I would like to discuss more business side of the issue.
Are we talking about lazy loading here? We know that movie
object exists and related to the parent object, but we will load it only at the time we really need it?
@yury-dymov That is indeed one case where this could happen. The point is that this library needs to follow the whole spec before it's usable, regardless of business case.
@eiktyrner, I agree with you regarding the spec. The point here is that I need to understand exact business cases for the optimal implementation.
Well, for json-api-normalizer it would be easy but for redux-object there would be no "easy fix" as far as I can see.
Should be resolved via https://github.com/yury-dymov/json-api-normalizer/commit/9eba58b7cf7aad488fa67129fcd494a1043ee0a2, please check.
redux-object will not support lazy loading as for now. I need to think regarding a good API for such occasion.
Update: implementation details: https://github.com/yury-dymov/json-api-normalizer#lazy-loading
Thanks for the quick help, that seems to solve my issue.
This throws
Cannot read property 'id' of undefined
While this works.
It seems that a data object is assumed for each relationship even though the spec says it's not required.