We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf3ca86 commit 7f54b1fCopy full SHA for 7f54b1f
examples/01-blog/graphql.php
@@ -35,13 +35,7 @@
35
// Parse incoming query and variables
36
if (isset($_SERVER['CONTENT_TYPE']) && strpos($_SERVER['CONTENT_TYPE'], 'application/json') !== false) {
37
$raw = file_get_contents('php://input') ?: '';
38
- $data = json_decode($raw, true);
39
- // $data += will cause 'Unsupported operand types' Fatal error on `null`
40
- // check if decoded data is an array (or stdobject) - not null
41
- // if any kind of data is present we don't want to lose it
42
- if ($data === null) {
43
- $data = [];
44
- }
+ $data = json_decode($raw, true) ?: [];
45
} else {
46
$data = $_REQUEST;
47
}
0 commit comments