Skip to content

GraphQlExportCommand uses deprecated getDefaultName() - breaks with Symfony 8 #7616

@lcottingham

Description

@lcottingham

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions