Skip to content

GraphQl query showing 500 when post when blank query

In Magento 2 when post graphql with empty query it results into 500 error.

It should not give 500 error and proper response.

https://www.test.com/graphql

{
“errors”: [
{
“message”: “Syntax Error: Unexpected “,
“locations”: [
{
“line”: 1,
“column”: 1
}
],
“extensions”: {
“file”: “/var/www/html/vendor/webonyx/graphql-php/src/Language/Parser.php”,
“line”: 437
}
}
]
}