Description
The GraphQlExportCommand uses the deprecated getDefaultName() static method instead of the #[AsCommand] attribute, causing this warning with Symfony 8:
The command defined in "ApiPlatform\Symfony\Bundle\Command\GraphQlExportCommand" cannot have an empty name.
Location
src/Symfony/Bundle/Command/GraphQlExportCommand.php (lines 78-81)
Current code
public static function getDefaultName(): string
{
return 'api:graphql:export';
}
Expected
Should use the #[AsCommand] attribute:
#[AsCommand(
name: 'api:graphql:export',
description: 'Export the GraphQL schema in Schema Definition Language (SDL)'
)]
Environment
- API Platform: 4.2.10
- Symfony: 8.0
- PHP: 8.4