How to modify returned data if an entry is returned via a relation

I have a collection of people, for whom I’d like to return a field that is calculated based on other fields of the person. This field is not in the schema, but gets added in the person controller (or service, doesn’t really matter here). This all works fine, but if I fetch another content type, that has one or more relations to the people collection, the people are returned without my custom field, because the person-controller or -service is never even called. Instead, Strapi seems to “directly” query the related entry, without calling my controller or service.

Now, I could modify all find and findOne controllers/services of all the endpoints of all the collections that have one or more relations to the person collection. However, because of the complexity of my app, this is not easily do-able and certainly not a clean way to go about this.

Is there any way to just modify the response in one place, where it would be applied to all responses, including those via relations?
Thank you for your help.

System Information

Shouldn’t really matter, but:

  • Strapi Version: 4.8.2
  • Operating System: Windows
  • Database: SQLite
  • Node Version: 16.15.0
  • NPM Version: 8.5.5
  • Yarn Version: 1.19.0