Skip to content

Commit 21e9ca9

Browse files
committed
fix problem in parsing logic with GraphQLFloat
1 parent ef76233 commit 21e9ca9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Types/GraphQLFloat.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ public function parseLiteral($valueNode, $variables)
2727
);
2828
}
2929

30+
//check if is parsable as a float
31+
if (!is_numeric($valueNode["value"])) {
32+
throw new GraphQLError(
33+
"Value cannot be represent as a float value: {$valueNode["value"]}",
34+
$valueNode
35+
);
36+
}
37+
3038
return floatval($valueNode["value"]);
3139
}
3240

0 commit comments

Comments
 (0)