The complexity score of a query can now be verified using a header
Live
March 5, 2025, 9:24 a.m.
What is changing?
From now on, you can easily verify the complexity of the query or mutation you want to check.
Just by adding a header to the request, you can get the complexity in the response.
This header will prevent the query from being executed, but it will return only its complexity.
Example
X-Kraken-Query-Complexity
header
body
query GetViewerAndAccount($accountNumber: String!) {
viewer {
email,
givenName,
id
}
account(accountNumber: $accountNumber) { id }
}
variables
{
"accountNumber": "A-12345678"
}
headers
{
"X-Kraken-Query-Complexity": true
}
response
{
"data": {
"viewer": {
"queryComplexity": 4
},
"account": {
"queryComplexity": 3
},
"totalQueryComplexity": 7
}
}