Actually, WD-40 has at least 20% oil so it will not dry out your chain. The oil is light in weight and won't produce very good chain life. Just to prove a point, I did a chain wear test, using nothing but WD-40 as my chain lube with an 11 speed chain. I got more elongation (after 1500 miles) than I had with my homebrew lube, so I stopped the test at that point.
The only problem with using to clean a chain is it's fairly expensive and once you have that light oil in there, you probably won't be able to get your regular lube into the chain until after the first ride.