From f1429e8155db65a8a71b8397cccf0bcc6583be52 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Fri, 30 Sep 2022 19:51:27 +1300 Subject: [PATCH] Move custom types to their own class --- src/Appwrite/GraphQL/TypeRegistry.php | 28 ------------------- src/Appwrite/GraphQL/Types.php | 40 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 28 deletions(-) create mode 100644 src/Appwrite/GraphQL/Types.php diff --git a/src/Appwrite/GraphQL/TypeRegistry.php b/src/Appwrite/GraphQL/TypeRegistry.php index 3fe6729d33..d2c8e16b59 100644 --- a/src/Appwrite/GraphQL/TypeRegistry.php +++ b/src/Appwrite/GraphQL/TypeRegistry.php @@ -13,9 +13,6 @@ use Utopia\Database\Database; class TypeRegistry { - private static ?Json $jsonType = null; - private static ?InputFile $inputFile = null; - private static array $typeMapping = []; private static array $defaultDocumentArgs = []; private static array $models = []; @@ -158,30 +155,5 @@ class TypeRegistry } return []; } - - /** - * Get the JSON type. - * - * @return Json - */ - public static function json(): Json - { - if (\is_null(self::$jsonType)) { - self::$jsonType = new Json(); - } - return self::$jsonType; - } - - /** - * Get the InputFile type. - * - * @return InputFile - */ - public static function inputFile(): InputFile - { - if (\is_null(self::$inputFile)) { - self::$inputFile = new InputFile(); - } - return self::$inputFile; } } diff --git a/src/Appwrite/GraphQL/Types.php b/src/Appwrite/GraphQL/Types.php new file mode 100644 index 0000000000..7a9aa9e54d --- /dev/null +++ b/src/Appwrite/GraphQL/Types.php @@ -0,0 +1,40 @@ +