Spellthrower Weapon Fusion
(from Starfinder Core Rulebook)
A weapon with the spellthrower fusion is able to have a single spell gem loaded into it at a time. It takes 1 minute to load a spell gem, and only gems containing a spell with a casting time of one standard action or less and a spell level no greater than one-quarter the weapon’s item level can be loaded into the weapon.
If you are proficient with and wielding the weapon, as a full action you can cast the spell contained within the spell gem rather than make a normal attack. This allows you to use the spell gem as if you were a spellcaster with the spell on your class’s spell list.
Unlike the normal rules for using a spell gem, it does not matter if the gem’s item level is higher than your caster level (even if your caster level is 0). However, if the spell gem’s item level is higher than your base attack bonus, once you’ve spent the full action to cast the spell, you must succeed at an attack roll with the weapon against an AC equal to the spell gem’s level + 1 or you fail to cast the spell. This roll represents your expertise with the weapon, and no actual attack or ammunition is used. If you fail to cast a spell from a spell gem, the spell is expended harmlessly and the spell gem is destroyed.