How to programmatically get the connections between expression nodes in a material?

In C++, given a UMaterial* I can enumerate the material’s expression nodes and examine various properties on them. I can also navigate down into material functions and enumerate their contents. However I want to find what inputs and outputs are connected, and can’t find anything that specifies this by looking at expression objects in the debugger. The UMaterial has a MaterialGraph field but this is null at runtime. Is this something that is doable?