I don’t know all the different kinds of cactus that can grow here in Texas. This looks like it might be a Peruvian Apple Cactus (Also known as Night Blooming Cereus). We had a small one in our yard for a few years. It really does only bloom at night, and each bloom only lasts for one night.
I read that the fruit is edible and tasty for humans or wildlife. The cactus gets really big, and this fruit is way out of reach for me though.
