The best way to solve this is still to use operation batching (https://community.visma.com/t5/Diskusjon/Please-enable-operation-batching/td-p/580571), but it doesn't work with the API as of yet. I've found an open GraphQL that supports batching in a sensible way. @Marius Bancila have a look at how they've solved batching in https://countries.trevorblades.com/graphql using the following body: [{
"query": "query Query($country: ID!) { country(code: $country) { name } }",
"variables": {
"country": "NO"
}
},
{
"query": "query Query($country: ID!) { country(code: $country) { name } }",
"variables": {
"country": "SE"
}
},
{
"query": "query Query($country: ID!) { country(code: $country) { name } }"
}] The last query will fail since it's missing "variables". This will return the following response: [
{
"data": {
"country": {
"name": "Norway"
}
}
},
{
"data": {
"country": {
"name": "Sweden"
}
}
},
{
"errors": [
{
"message": "Variable \"$country\" of required type \"ID!\" was not provided.",
"locations": [
{
"line": 1,
"column": 13
}
]
}
]
}
] I think this is a sensible approach.
... View more