Compatibility between 4700 Tiagra 10 speed shifters and GRX RX400 10 speed derailleur
Looking at Shimano's Compatibility Document one can see that indeed, Tiagra ST-4700 brifters are compatible with their rear derailleur model RD-RX400.
Can't blame you for wanting to stick with rim brakes.  Although hydraulic disc systems are not as complicated or difficult to work with as it may seem, there are some negative aspects that (IMHO) make a quality rim break quite competitive with disc brakes.  From a cost stand point--both initial and continuing maintenance-- rim brakes have a lock on value.  The relatively minor edge on performance disc brakes have is a fairly costly one.