Skip to content

Commit eaadae4

Browse files
authored
Merge pull request #187 from gabidj/patch-1
Fixed minor bug in example
2 parents 57f5ee3 + 9b44974 commit eaadae4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/01-blog/graphql.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@
3535
// Parse incoming query and variables
3636
if (isset($_SERVER['CONTENT_TYPE']) && strpos($_SERVER['CONTENT_TYPE'], 'application/json') !== false) {
3737
$raw = file_get_contents('php://input') ?: '';
38-
$data = json_decode($raw, true);
38+
$data = json_decode($raw, true) ?: [];
3939
} else {
4040
$data = $_REQUEST;
4141
}
42+
4243
$data += ['query' => null, 'variables' => null];
4344

4445
if (null === $data['query']) {

0 commit comments

Comments
 (0)