These findings suggest ZHX2 as a prognostic biomarker, and immune infiltration could be associated with the effect of ZHX2 on gastric cancer. This evidence concerns the gene ZHX2 and gastric cancer.