Shimano XT or GRX???

Hi guys.

Some advice please…

I’m about to go into the di2 world for the first time on my 1 x Gravel bike.

I am looking at either the GRX 817 rear mech or the XT 8050 or 9050 rear mechs.

I am unsure around the drivetrain capacity of the XT mechs as they state 35T? I’ve tried to work this out but as the calculations involve two chain rings normally I’m not sure if it applies to 1 x systems.

I would be looking at using a 42T up front and a 11-42 rear cassette.

Would the XT system cater for this? I’d be looking at the medium cage XT mech.

The GRX 817 specifics don’t mention anything about drivetrain capacity!!

Confused…….you will be. Please give me some help!!