Hiding attachment paths from graph view

I don’t know a way. There is an open feature request here: Short Paths in Graph View

Personally, I just hide attachments in the graph.