I'm designing a Laravel API and have the following problem.
The API will be consumed by a Mobile Application, a Web Application (running Vue), as well as third parties using the API to extract data for their own use.
Lets say I have a User table which has 30 different columns in the database, the Mobile Application may only need 4/30 of these columns, the Web Application may need some different arbitrary amount, for example 8/30 columns and the third parties would need 30/30.
I feel it's a waste of resources to return all 30 columns to Mobile Application which is only going to need 4 of them on every request.
How can I satisfy all 3 parties at once, am I forced to return all 30 columns to the Mobile Application?
I have about 100 tables, so this would be spread across them all and lots of not needed data would be pulled from the API all the time.
Is there a way to approach this problem so each application/party only gets what they want? Without creating extra API endpoints for each of them.