Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | public function parseLiteral($valueNode, ?array $variables = null) |
||
17 | { |
||
18 | // Note: throwing GraphQL\Error\Error vs \UnexpectedValueException to benefit from GraphQL |
||
19 | // error location in query: |
||
20 | if (!($valueNode instanceof StringValueNode)) { |
||
21 | throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, $valueNode); |
||
22 | } |
||
23 | |||
24 | return $valueNode->value; |
||
25 | } |
||
45 |