1
0
Fork 0
mirror of synced 2024-07-07 23:46:11 +12:00

Upcase type names

This commit is contained in:
Jake Barnby 2022-09-29 17:53:07 +13:00
parent 6c81069b27
commit e5b9e261c5
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
2 changed files with 3 additions and 3 deletions

View file

@ -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;

View file

@ -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),
];
}