Closed rufinus closed 2 years ago
Hi!
This use case doesn't return an Hydrated UserView
but an array. You can look at the handler: https://github.com/jorge07/symfony-5-es-cqrs-boilerplate/blob/symfony-5/src/App/User/Application/Query/User/FindByEmail/FindByEmailHandler.php#L29
The reason is that the read model is already optimised for the purpose so there's no need to have a custom class for it so you can return literals in an associative array and skip the hydration cost.
If for your needs you need to return a UserView
object, there's absolutely no need for you to return an Item
but any other thing you need and convert it into openApi spec later on in the controller.
Hi, first of all - thanks für the boilerplate. I begin to get a hang on it.
If I use the QueryBus like
$this->queryBus->ask(new FindByEmailQuery($email));
the result is aItem
Object with typeUserView
. I can't figure out how to get theUserView
out of it. I can access the array keys in theresource
but I dont think this is how you should access them. What do I miss?TIA Ludwig