While the graphite would lubricate the parts, it would do nothing to repel moisture and prevent corrosion. Also, if the graphite ever got wet it'd turn into a crusty mess. Not to mention that it'd be likely that every time you handled the gun would get graphite dust all over your hands, the gun, your clothes, etc...
If you want a lube that, when applied correctly, leaves both a semi-dry lubricant (teflon) as well as being an outstanding rust preventing preservative, then get yourself a bottle of "Break-Free CLP". It's the same stuff that is issued and used my the U.S. military and it is very good stuff. While wet it acts as a mild solvent for cleaning, then after cleaning a very light coat is applied to all parts you want to lube and/or preserve. After a little time all that's left is a fairly dry feeling coating. The military had CLP developed to provide Marines (and soldiers) in the field with a means to perform all three vital weapon maintenence functions (cleaning, lubricating, and preserving) in one bottle, thereby reducing the amount of crap the Marine has to carry. The other requirement was that the lube/preservative could be applied light enough that the weapons wouldn't attract excess dust and dirt like conventional gun oils.
Over the years i've tried one heck of a lot of different lubes, and NOTHING even comes close to doing the job "Break Free" does!!! These days it's all i use on anything that's important to me!!!
It's one fine long lasting lube, that keeps "build up" to a min. once you get all the "other stuff" cleaned out too!!
The "dry lubes" are my prefered lubricant for ALL my firearms. No oils (wet)!
I use the oil-less lubricants from LPS (about $9-$10/can). LPS #1 & LPS #2, I believe. These spray on "wet" and quickly dry to a very soft white "haze", this "haze" really allows you to visually confirm exactly what is coated & protected and what is not. These lubes, once dry, will not attract dirt, dust, lint or foam from your gun cases. And yes they are moisture repellent. All Mil-spec.
Of course the first priority of 99.9% of guys is repelling moisture. I was looking for a lube that would not only repel moisture but I really couldn't stand how much dirt & lint (especially lint!) would get stuck on my firearms, even in a mostly "enclosed" holster. Bacically the lint build up was the reason for cleaning more that anything else. Since I've used these lubes, I have to go down to the dryer to find lint. (And generally I try to avoid being seen anywhere near the washer and/or dryer-if ya know what I mean)