It's a constantly changing thing. One day there will be a way to have root and run PGO (thanks to it using SafetyNet) and the next Google will block that method.
AS of earlier this week Magisk is now detected and won't work anymore (unless it's been updated in the past 12 hours, haven't looked). Some people have luck with the latest SuperSU and an app called Root Switch. Feel free to read up the last 10 or so pages here,
[Discussion] PokeMon Go Magisk Discussion Thread. Also read up zapahacks long
post that describes how he got it to work on his newer Samsung device. I have root working on my Note 5 following his method.