Open PHPist opened 1 year ago
This is relevant for me, can it be fixed?
I have the same problem... I hope guys you fix this bug as soon as possible
+1
Hi @PHPist , thank you for the issue well documented.
Could you ensure please the json URL is correct?
The problem is here.
This was a performance enhancement to not load the same data twice from the DB.
Still looking into a good fix:
Thanks for the quick reply! Yes I saw that and assumed it was an optimization too. We even wanted to figure out how to flesh this out on the front end of the app. But the behavior is very unpredictable. So repeating the relationships would be the right thing to do. Like Laravel does (with, load).
Models relationships
GET /houses/1?include=apartments.owner.phones returns
https://jsoneditoronline.org/#left=cloud.15ee4ba500164dc9bce7386c5506263b&right=cloud.7126537776eb42c1bd1c35efdb49c4d8
Two apartments in the building (number 50, 88) belong to the same owner. The first object has owner.phones in the second one does not.
example: https://github.com/PHPist/restify-test