The X7 is mated with a SRAM PG 1050 11-36 cassette. I would like to replace the derailleur without replacing the cassette.
The SRAM X7 RD and the PG-1050 cassette are 10-speed items. The GX AXS is a 12-speed wireless electronic RD.
You can’t program the RD to shift through 10 cogs unless you can somehow rewrite the firmware for the AXS system. It will only move the RD enough to shift a 12s cog. It has no way of knowing that you have 10 cogs.
unfortunately, you won’t just need a new cassette. The Hyperglide freehub body is too wide to take a 10t starting cog. You will need a SRAM XD body, which is shorter than the HG body and the 10t cog hangs off the end. Unfortunately, you can’t guarantee that such a freehub body is available for your hub, especially if it’s an OEM hub.
For general interest, Archer Components makes a wireless shifting system. There's a wireless transmitter on your handlebar. That communicates with a shifting unit that you attach to your chainstay, which uses a cable to shift an existing rear derailleur. I believe it may currently be able to handle between 10 and 13 cogs in the rear, programmable on an app. I believe it can account for the RD's cable pull as well. In principle, SRAM could have set up AXS this way (e.g. let you program it to shift through 11 or 12, or even 10 gears in the app), but they don’t have an economic incentive to do so.