How to format api response structure in v4

GraphQl is built for this purpose, to filter and mutate in the actual request. Fetch only what you need