When planting dragon fruit cactus outdoors in its final location, as when you grew the dragonfruit seedlings from the original dragonfruit seeds, or propagated the dragonfruit cuttings to prepare the dragonfruit cactus for final planting, you want your soil to be well drained or even to use raised beds if rains are a problem in your location.
Because the dragonfruit cactus is a cactus / succulent, it can more readily tolerate periods of dryness than it can tolerate long periods with too much moisture. Bear this in mind when when planting dragon fruit and choosing a location and preparing the soil and/or planting area. It is better to have soil that drains well and perhaps gives the dragonfruit cactus a few moderate periods of dryness during the annual cycle than to have soil which does not drain well and gives periods of soaked and sodden soil which can cause rot of the cactus plant. The climate that dragon fruit plants can grow in best is tropical, so you will likely have rainy days as well as sunny ones! Even dragon fruit California plantings get rain too other than from irrigation systems!
The dragonfruit cactus prefers soil rich in organic matter or with added organic material (e.g. manure compost). Remember all of the nutrients the dragonfruit cactus puts into growing and growing dragonfruit fruit come from the soil in which the dragonfruit grows and as the dragonfruit fruits will be harvested they will not compost into the soil and provide nutrients for the dragonfruit cactus as in a natural environment.