Merge pull request #187 from gabidj/patch-1

Fixed minor bug in example
This commit is contained in:
Vladimir Razuvaev 2017-10-19 12:02:46 +07:00 committed by GitHub
commit eaadae4a5b

View File

@ -35,10 +35,11 @@ try {
// Parse incoming query and variables
if (isset($_SERVER['CONTENT_TYPE']) && strpos($_SERVER['CONTENT_TYPE'], 'application/json') !== false) {
$raw = file_get_contents('php://input') ?: '';
$data = json_decode($raw, true);
$data = json_decode($raw, true) ?: [];
} else {
$data = $_REQUEST;
}
$data += ['query' => null, 'variables' => null];
if (null === $data['query']) {