Gastric cancer is caused by both genetic and environmental factors. A woman who suffered from recurrent candidiasis throughout her life developed diffuse-type gastric cancer at the age of 23 years. Using whole-exome sequencing we identified a germline homozygous missense variant in MYD88. Immunological assays on peripheral blood mononuclear cells revealed an impaired immune response upon stimulation with Candida albicans, characterized by a defective production of the cytokine interleukin-17. Our data suggest that a genetic defect in MYD88 results in an impaired immune response and may increase gastric cancer risk.