to get a related entities using the json:api I can use ex: ?include=uid,uid.user_picture in the parameter, and all the related entities will be returned in the included object, then the front application needs to apply some logic to get the entity(ex: node)+ related entity fields (ex: author email) and then I want to get the author is image , so the front will need to handle a lot of loops, so I have used the JSON:API Include module it works by embeding the relationships one inside another automaticall,but it have some drawbacks so can any one help me to figure out what is the best solution ?
without JSON:API Include module :
the json HTTP response size will be smaller,also the json structure respect the JSON API specification which make it more stable and understandable(relationships , included..) but the processing in the front application will be heavier if we have a lot of relationships.
with JSON:API Include module :
easy processing for the front application but the json HTTP response size will be bigger ,and the JSON:API specification will be broken(no relationships or included object all will be shifted into the data object).