Split it into two options:
- alias batching
- array batching
Additionally, perform excessive testing of this solution.
1. Alias Batching
query GetMultipleUsers {
user1: user(id: "101") { name, email }
user2: user(id: "102") { name, email }
latestPost: post(id: "abc") { title }
}
2. Array Batching
[
{ "query": "query { user(id: 1) { name } }", "variables": {} },
{ "query": "query { post(id: 99) { title } }", "variables": {} }
]
The server must be explicitly configured to accept an array of queries (e.g., batching: true in Apollo Server).
Split it into two options:
Additionally, perform excessive testing of this solution.
1. Alias Batching
2. Array Batching
[ { "query": "query { user(id: 1) { name } }", "variables": {} }, { "query": "query { post(id: 99) { title } }", "variables": {} } ]The server must be explicitly configured to accept an array of queries (e.g.,
batching: truein Apollo Server).