Closed IzabelaTimofte closed 1 year ago
Hi @IzabelaTimofte! Thank you for the PR. Did you checked https://github.com/overblog/GraphQLBundle/blob/master/docs/definitions/type-system/enum.md#working-with-native-php-81-enums
There is no attribute with EnumValue
cause it was used only to attach description or deprecated reason to a value cause before PHP 8.1 and the attributes, the annotations library was not able to handle annotation on contants. That's why this EnumValue
was used.
Now with attributes, you can attach directly the #GQL\Description
to the enum value as in the example here:
#[GQL\Enum]
enum Color
{
#[GQL\Description("The color red")]
case RED;
case GREEN;
case BLUE;
}
So attribute is useless on EnumValue
Thank you Vincz,it works, I will close the pull request.
Added Attribute definition on EnumValue