diff --git a/src/Appwrite/GraphQL/Types/InputFile.php b/src/Appwrite/GraphQL/Types/InputFile.php index 17ee6a0061..c10591ef57 100644 --- a/src/Appwrite/GraphQL/Types/InputFile.php +++ b/src/Appwrite/GraphQL/Types/InputFile.php @@ -16,7 +16,7 @@ class InputFile extends ScalarType public function serialize($value) { - throw new InvariantViolation('`InputFile` cannot be serialized'); + return ''; } public function parseValue($value) diff --git a/src/Appwrite/GraphQL/Types/Json.php b/src/Appwrite/GraphQL/Types/Json.php index c430543c9b..2ebf2d39b0 100644 --- a/src/Appwrite/GraphQL/Types/Json.php +++ b/src/Appwrite/GraphQL/Types/Json.php @@ -21,12 +21,12 @@ class Json extends ScalarType public function serialize($value) { - return $this->identity($value); + return \json_encode($value); } public function parseValue($value) { - return $this->identity($value); + return \json_decode($value, associative: true); } public function parseLiteral(Node $valueNode, ?array $variables = null) @@ -51,9 +51,4 @@ class Json extends ScalarType return null; } } - - private function identity($value) - { - return $value; - } }