Traditional Chinese Medicine(TCM) is a highly empirical, subjective and practical discipline. One of the most realistic data mining tasks in TCM is prescription generation. While recommendation models could be applied to provide herb recommendation, they are limited to modeling only the interactions between herbs and symptoms, ignoring the intermediate process of syndrome induction, which betrays a main principle in real-world TCM diagnosis: doctors suggest herb based on the holism syndrome inducted from symptoms. Targeting on this pain point, we proposed TCMCoRep, a novel graph contrastive representation learning framework with explicit syndrome awareness. For a given symptom set, predictive representation from TCMCoRep not only locates high quality prescription herbs but also explicitly detects corresponding syndrome via syndrome-aware prescription generation that follows the philosophy of TCM diagnosis in real life. Hybridization of homogeneous and heterogeneous graph convolutions is able to preserve graph heterogeneity preventing the possible damage from early augmentation, to convey strong samples for contrastive learning. Experiments conducted in practical datasets demonstrate our proposed model’s competitive performance compared with existing state-of-the-art methods, revealing the great potential in real-world applications. Our source code is available at https://github.com/Yonggie/TCMCoRep .