WD-40 can be used as a cleaner, but it's not a good lubricant and tends to gum up quickly.
If you use it, spray the parts thoroughly and let soak a while. They wipe it off and apply an actual lubricant.
I don't think I'd use it in a trigger group because it will soak into the pins and pin holes and can't be wiped off.
That will gum up and cause problems.
If you want something better, Rem-Oil is a good cleaner and a fair lubricant, although it's fairly thin and tends to run off.
It will dissolve old lube and flush out debris, then soak into all areas and lubricate without gumming up.
Apparently the idea that something like WD-40 can infiltrate a primer and cause dead primers is not true.
The "Box O Truth" did a test where they put primed cases head up in blocks and put good drops of various penetrating fluids on the primers.
After some good soaking not one primer failed.