Thanks Phil,
I think removing whitespaces ended up being sufficient in the end.
When eventually moving to GraphQL, it will definitely need a larger refactor in how I return queries and structure the data. Though when I come to it, I'll solve that issue.