Open ageurts opened 1 year ago
So I found that escaping the class in the Annotation with 4 slashes fixes the generated class.
<?php
namespace App\GraphQL\CustomTypes;
use Overblog\GraphQLBundle\Annotation\Scalar;
#[Scalar(name: 'UploadImage', scalarType: '@=newObject("Overblog\\\\GraphQLBundle\\\\Upload\\\\Type\\\\GraphQLUploadType")')]
class UploadImageType
{
}
But I'm guessing this is not supposed to work like this.
I'm using annotations in Symfony 6 on PHP 8.1 and I'm trying to define a custom scalar type for using the file upload feature. Somehow the scalarType class name is not processed correctly and I end up with a faulty Type class.
This is my definition:
and this is the (faulty) generated Type class (see the scalarType line):
The scalar class 'OverblogGraphQLBundleUploadTypeGraphQLUploadType' does not exist of course.
The Type class is generated correctly if I use the YAML variant.
UploadImageType.php:
Is this a bug in the type class generation or am I using Annotations wrong?