I try to access stock data for a product, using
and receive the following error on this line
PHP Fatal error: Call to a member function getIsInStock() on null.
stock_item extension attribute was not loaded.
$product comes from the product repository and has been loaded with
How can I get products with stock information from the product repository?