Like most diseases, there are genetic and environmental factors that influence the development, course, and severity of mental illness. It's not either/or; you're all right. Check out the Stockholm adoption study from the 80's and subsequent similar work on alcoholism. Or the multiple GWAS linking certain polymorphisms to schizophrenia.
Humanity's understanding of genetics is pretty superficial at this point. Even for minority of diseases for which we understand the exact genetic cause (Trisomy 21 causing Down syndrome, A to T switch on the beta globin gene causing sickle cell, delta F508 on the CFTR gene causing cystic fibrosis), there are still huge variations in phenotype that we do not fully understand and that, once again, probably have both genetic and environmental determinants.