I'm fairly new to GraphQL, so please correct me if I'm wrong where need be. I'm wondering what would be the best way, or the most appropriate way, to execute batch queries in a single request. I've seen examples that do this:
[
{
query: "query(param1)"
},
{
query: "query(param2)"
}
]
Or examples that use aliases to accomplish the same thing:
query {
alias1: resolver1(param1)
alias2: resolver2(param2)
}
In my opinion, I think the aliases is the more appropriate option as it's a single query and within that query I'm requesting data with different parameters. So, between the two options above, what would be the more appropriate option for executing batch queries in GraphQL, and why? Thanks!