forked from mll-lab/graphql-php-scalars
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMixed.php
More file actions
37 lines (30 loc) · 850 Bytes
/
Copy pathMixed.php
File metadata and controls
37 lines (30 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
declare(strict_types=1);
namespace MLL\GraphQLScalars;
use GraphQL\Type\Definition\ScalarType;
use GraphQL\Utils\AST;
class Mixed extends ScalarType
{
/**
* The description that is used for schema introspection.
*
* @var string
*/
public $description = <<<'DESCRIPTION'
Loose type that allows any value. Be careful when passing in large `Int` or `Float` literals,
as they may not be parsed correctly on the server side. Use `String` literals if you are
dealing with really large numbers to be on the safe side.
DESCRIPTION;
public function serialize($value)
{
return $value;
}
public function parseValue($value)
{
return $value;
}
public function parseLiteral($valueNode, ?array $variables = null)
{
return AST::valueFromASTUntyped($valueNode);
}
}