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.
2 parents 57f5ee3 + 9b44974 commit eaadae4Copy full SHA for eaadae4
examples/01-blog/graphql.php
@@ -35,10 +35,11 @@
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);
+ $data = json_decode($raw, true) ?: [];
39
} else {
40
$data = $_REQUEST;
41
}
42
+
43
$data += ['query' => null, 'variables' => null];
44
45
if (null === $data['query']) {
0 commit comments