Total Complexity | 6 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
13 | class DateTimeType extends ScalarType |
||
14 | { |
||
15 | public function parseLiteral($valueNode) |
||
16 | { |
||
17 | // Note: throwing GraphQL\Error\Error vs \UnexpectedValueException to benefit from GraphQL |
||
18 | // error location in query: |
||
19 | if (!($valueNode instanceof StringValueNode)) { |
||
20 | throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, [$valueNode]); |
||
21 | } |
||
22 | |||
23 | return $valueNode->value; |
||
24 | } |
||
25 | |||
26 | public function parseValue($value) |
||
33 | } |
||
34 | |||
35 | public function serialize($value) |
||
44 |