In Magic weapons 5e spell you do touch a nonmagical weapon. But until the spell would be end, that weapon will become a magic weapon with the +1 bonus to attack rolls and also the damage rolls.
At Higher levels:
Whenever you cast this d&d 5e magic weapon spell by using the spell slot of 4th level or more than it , the bonus would increases to +2. whenever you do use a spell slot of 6th level or higher, the bonus would increase to +3.
|Casting Time||1 bonus action|
|Duration||Up to 1 hour|
|Higher Spell Slot Desc||When you cast this spell using a spell slot of 4th level or higher, the bonus increases to +2. When you use a spell slot of 6th level or higher, the bonus increases to +3.|
|Target||A nonmagical weapon|