Both Booming Blade and Green Flame Blade have the following text:
You make a single melee weapon attack against a creature you can see within the spell's range. If the attack hits…
Reading this question makes me believe that a weapon which has been magically enchanted or enhanced, even temporarily, would overcome this immunity, and that both base weapon damage and cantrip damage would apply on a hit (and double on a critical hit).
Question: What damage, if any, would be generated by attacking a creature (with immunity to damage from non-magical weapons) with a non-magical weapon as part of a Booming Blade or Green Flame Blade attack?
Best Answer
The base weapon attack that's part of the cantrip doesn't become magical.
Rules designer Jeremy Crawford unofficially addresses this question in a 2017 tweet:
So the weapon attack you make as part of the spell is not magical on its own. The two cantrips call for a weapon attack made as part of the cantrip, but the weapon attack on its own is not stated as being modified to become magical; there are simply additional effects to the attack that are granted by the cantrip.
...But the extra damage is magical.
The booming blade spell description says (SCAG, p. 142; emphasis mine):
Similarly, green-flame blade says (SCAG, p. 143; emphasis mine):
When the caster of either cantrip reaches higher levels, the initial attack does extra damage as well (in addition to boosting the secondary damage).
Per Crawford's unofficial guidance above, the required weapon attack remains nonmagical; the fact that the spell calls for a normal weapon attack doesn't change the properties of the weapon. However, the added damage done by the spell itself is magical, as it's caused directly by the spell. This is true both of the secondary damage of both spells, and of the extra initial damage both spells do at higher levels.