* Serializes an internal value to include in a response.
25
*/
26
1
public function serialize(mixed $value): never
27
{
28
1
throw new InvariantViolation('`Upload` cannot be serialized');
29
}
30
31
/**
32
* Parses an externally provided value (query variable) to use as an input.
33
*/
34
3
public function parseValue(mixed $value): UploadedFileInterface
35
{
36
3
if (!$value instanceof UploadedFileInterface) {
37
1
throw new UnexpectedValueException('Could not get uploaded file, be sure to conform to GraphQL multipart request specification. Instead got: ' . Utils::printSafe($value));
38
}
39
40
2
return $value;
41
}
42
43
/**
44
* Parses an externally provided literal value (hardcoded in GraphQL query) to use as an input.
45
*/
46
1
public function parseLiteral(Node $valueNode, ?array $variables = null): mixed
47
{
48
1
throw new Error('`Upload` cannot be hardcoded in query, be sure to conform to GraphQL multipart request specification. Instead got: ' . $valueNode->kind, $valueNode);