From e5b9e261c5fe30d82b3ff5ecb4fdf850f65a3858 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 29 Sep 2022 17:53:07 +1300 Subject: [PATCH] Upcase type names --- src/Appwrite/GraphQL/SchemaBuilder.php | 2 +- src/Appwrite/GraphQL/TypeRegistry.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/GraphQL/SchemaBuilder.php b/src/Appwrite/GraphQL/SchemaBuilder.php index b9442964e3..b1a1f48315 100644 --- a/src/Appwrite/GraphQL/SchemaBuilder.php +++ b/src/Appwrite/GraphQL/SchemaBuilder.php @@ -124,7 +124,7 @@ class SchemaBuilder : [$models[$responseModelNames]]; foreach ($responseModels as $responseModel) { - $type = TypeRegistry::get($responseModel->getType()); + $type = TypeRegistry::get(\ucfirst($responseModel->getType())); $description = $route->getDesc(); $params = []; $list = false; diff --git a/src/Appwrite/GraphQL/TypeRegistry.php b/src/Appwrite/GraphQL/TypeRegistry.php index 31504fc875..3fe6729d33 100644 --- a/src/Appwrite/GraphQL/TypeRegistry.php +++ b/src/Appwrite/GraphQL/TypeRegistry.php @@ -85,12 +85,12 @@ class TypeRegistry $fields = []; - $model = self::$models[$name]; + $model = self::$models[\lcfirst($name)]; if ($model->isAny()) { $fields['data'] = [ 'type' => Type::string(), - 'description' => 'Data field', + 'description' => 'Additional data', 'resolve' => static fn($object, $args, $context, $info) => \json_encode($object, JSON_FORCE_OBJECT), ]; }