API Platform version(s) affected: 4.1
Description
It is not possible to return a mixed result (array with object and scalar) in the Doctrine Orm ItemProvider.
The current signature allow only null or object to be returned.
public function provide(Operation $operation, array $uriVariables = [], array $context = []): ?object
How to reproduce
Add to the queryBuilder a scalar value to select along the entity in order to make Doctrine return a mixed result.
Possible Solution
Change the return signature like the following.
public function provide(Operation $operation, array $uriVariables = [], array $context = []): null|array|object