When marshaling the result to be sent back through the client app that requests the data, it would be nice to lessen the payload by simply excluding the unnecessary relationship data which were not preloaded or eagerly loaded in the model.
Keep the payload of data transfer to a minimum. the unnecessary data can grow twice or more specially if the result returns many rows.
Related Issues
Comment From: github-actions[bot]
The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking ✨
Comment From: saeidee
This is related more to your application business logic, which means you want to use an entity as a response, you may try to use a different struct for your response/s and prepare it how you would like to send the data.
Comment From: Roldification
Oh that's it. Thank you for the assistance. I'm sorry if I added immaterial things here in issues. I would be more grateful if you could just show me a brief example on how to implement that? Thank you my good sir.