How to save multiple query variables result as separate field in custom data structure as a result?

Hi Michel,
I have multiple group of nodes. Instead of retrieving every group with single query. For the performance reason, I’m trying to do those multiple queries in single query. So what is the idiomatic way to return every group’s result as JSON object field’s value.