From 4ec637f8892f106a9f48b56f5ae3617b652df9ec Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 7 Jul 2022 12:54:59 +1200 Subject: [PATCH] Update input file scalar definition --- src/Appwrite/GraphQL/Types/InputFile.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Appwrite/GraphQL/Types/InputFile.php b/src/Appwrite/GraphQL/Types/InputFile.php index 4cd930e90a..7f9dc06d1a 100644 --- a/src/Appwrite/GraphQL/Types/InputFile.php +++ b/src/Appwrite/GraphQL/Types/InputFile.php @@ -6,23 +6,22 @@ namespace Appwrite\GraphQL\Types; use GraphQL\Error\Error; use GraphQL\Error\InvariantViolation; +use GraphQL\Language\AST\Node; use GraphQL\Type\Definition\ScalarType; -use GraphQL\Utils\Utils; -use Psr\Http\Message\UploadedFileInterface; -use UnexpectedValueException; class InputFile extends ScalarType { /** + * @var string * @var string */ - public $name = 'Upload'; + public $name = 'InputFile'; /** * @var string */ public $description - = 'The `Upload` special type represents a file to be uploaded in the same HTTP request as specified by + = 'The `InputFile` special type represents a file to be uploaded in the same HTTP request as specified by [graphql-multipart-request-spec](https://github.com/jaydenseric/graphql-multipart-request-spec).'; /** @@ -34,7 +33,7 @@ class InputFile extends ScalarType */ public function serialize($value) { - throw new InvariantViolation('`Upload` cannot be serialized'); + throw new InvariantViolation('`InputFile` cannot be serialized'); } /** @@ -50,12 +49,13 @@ class InputFile extends ScalarType /** * Parses an externally provided literal value (hardcoded in GraphQL query) to use as an input. * - * @param \GraphQL\Language\AST\Node $valueNode + * @param Node $valueNode * * @return mixed + * @throws Error */ public function parseLiteral($valueNode, ?array $variables = null) { - throw new Error('`Upload` cannot be hardcoded in query, be sure to conform to GraphQL multipart request specification. Instead got: ' . $valueNode->kind, $valueNode); + throw new Error('`InputFile` cannot be hardcoded in query, be sure to conform to GraphQL multipart request specification. Instead got: ' . $valueNode->kind, $valueNode); } } \ No newline at end of file