Bikepacking has published an article on this subject. What you want to do is called a 'mullet' drivetrain (using a MTB derailleur with brifters). The basic problem is that pull-ratios on MTBs and road/gravel bikes don't match, so there's no 'factory way' of achieving this (speaking about mechanical derailleurs, it's possible with electric derailleurs, but that's another budget).
There's a configuration that can match your criteria: it involves a SRAM Eagle SX MTB derailleur, a Jtek ShiftMate 9 converter (that allows to use a SRAM MTB derailleur with SRAM brifters) and a Sunrace 11/51 cassette.
There is also another solution that is mentioned: buying a new cage for your current derailleur, from the Garbaruk brand.
Keep however in mind that these are "hacks" that may void the warranty. But the offer in gravel transmissions is quite limited, and except investing in an electronic transmission (super expensive), there's not so much that can currently be done.