I'm wanting to modify the contents of some fields at display time so looked at
hook_node_view(), however, the
$build array is not what I'm expecting, if I dump it with
var_dump it is thousands of lines long and not in the format I'm expecting a render array to be, it includes all sorts of exciting things like SQL connection objects which are of no use to me but there is no obvious set of elements that I'd be expecting to see given the Drupal documentation. If I drill down the array, I can find the data I need, however, I can't see how to get this sorted in the correct display order.
If I add a simple tweak like
$build['title'] = ['#markup' => "Hello World"];
the node title is rendered correctly as the new value so I know I'm roughly in the right place.
Question, how can I get at the fields collection after extraction from the database and sorting into display order but before it hits the template as I need to be able to make changes at this point as future development will require potential output via differing templates.