Possible errors of queries & mutations available through dedicated query and header
What is changing?
The possibleErrors
GraphQL field, which was available on all mutations, is now deprecated. It is replaced by:
- the
possibleErrors
query - the
X-Possible-Errors
header
Both these features allow you to get a comprehensive list of all errors that can be raised when executing a specific query or mutation: using only the query name with the possibleErrors
query, or using the full query string with the X-Possible-Errors
header.
A preliminary removal date is set for the 5th of March 2025.
What do I need to do?
Please stop using the possibleErrors
field directly.
Instead, send your full query or mutation with the proper variables, and add a X-Possible-Errors
header: it will validate the format of your variables as well as that of your query string, but without actually executing it, and return the list of all the errors that could be raised.
Additionally, you can get the same information with just the name of the query/mutation by using the new possibleErrors
query.
Examples for obtainKrakenToken mutation
With X-Possible-Errors
header
{
"data": {
"obtainKrakenToken": {
"possibleErrors": [
{
"code": "KT-CT-1113",
"message": "Disabled GraphQL field requested.",
"description": "You have made a request to a disabled GraphQL field.",
"type": "SERVICE_AVAILABILITY"
},
{
"code": "KT-CT-1135",
"message": "Invalid data.",
"description": "Please make sure the refresh token is correct.",
"type": "VALIDATION"
},
{
"code": "KT-CT-1134",
"message": "Invalid data.",
"description": "The refresh token has expired.",
"type": "VALIDATION"
}
]
}
}
}
With possibleErrors
query
{
"data": {
"possibleErrors": {
"name": "obtainKrakenToken",
"type": "mutation",
"authErrors": true,
"possibleErrors": [
{
"code": "KT-CT-1135",
"type": "VALIDATION",
"message": "Invalid data.",
"description": "Please make sure the refresh token is correct."
},
{
"code": "KT-CT-1134",
"type": "VALIDATION",
"message": "Invalid data.",
"description": "The refresh token has expired."
},
{
"code": "KT-CT-1113",
"type": "SERVICE_AVAILABILITY",
"message": "Disabled GraphQL field requested.",
"description": "You have made a request to a disabled GraphQL field."
}
]
}
}
}