It depends on your rear derailleur.
If you have an AXS drivetrain, then yes! If you are using a mechanical drivetrain, then you will need to determine if you have 520% printed on the inner cage, meaning you can use the 10-52T cassette! If 520% is not present on the derailleur, then you can only use the 10-50t cassette.
For further information, please visit our SRAM Eagle compatibility map.