One could use the mean if the optimizer was already on the graph informing that mean, but not otherwise
I have no idea what an optimizer inside a graph informing a mean means.
What I was saying is if you have, say, a LogNormal observational model and want to optimize the expected value you can optimize the “analytical mean”/first moment of the distribution from the posterior draws of the parameters of that LogNormal and whatever parameters you want to tune.
You don’t need to draw a bunch of posterior predictive draws to then take its mean.