How to get all nodes of a content type as header menu item?
You can configure content type to create menu items. So look at content type configuration.
It will dynamically create menu items when new node is created.