There is no “TGraph3D” in ROOT, so you will need to use a different approach, e.g.:
Another possibility would be to create a TH3? histogram and fit it with a TF3 fuction.
TH3?
TF3