This question already has an answer here:
What would be the feasibility of short ranged weapons, such as swords, brass knuckles, clubs and gauntlets in a sci-fi-fantasy setting?
To clarify further, we are ignoring the standard bullet-beats-knife scenario, we are talking about sci-fi-fantasy, in a universe where both highly advanced technology exists both in coexistence and in standalone form from any sort of magic or special non-standard-universal-rules powers, in particular we are talking if there would be any sort of usage and if it would be of any use, in normal sci-fi scenarios we can almost instantly remove the regular usage for any melee weapons (excluding the odd light saber) because typically sidearms such as high powered pistols would have taken the role of these weapons. But what about a more non standard setting? Could a high-elf carrying a magical claymore have any chance against a human carrying a highly powered mag-prop gun? Or would everyone eventually decide that high-technology is a much better choice?
Further clarification, since my question was flagged as a duplicate: it is not a purely sci-fi setting, its a sci-fi fantasy, meaning that this particular universe isn't purely centered around highly powerful technologies, but highly powerful technologies with magical properties added, in this particular scenario we are also discarding any sort of energy pulse weapons i.e. Lasers or Plasma beams, and most weapons are based on ballistic or magnetic propellants. The question in factor was to ask if melee weapons, wielded by magic users, could have any sort of use against non-magic users wielding long-ranged firearms.