"Who invented ?" is an almost meaningless question. Edison and Swan bear the primary responsibility for producing practical and economical lightbulbs and the electricity distribution systems required for them. But both men were undeniably standing on the shoulders of giants.
The same is true for almost any invention. Most successful inventions aren't created by geniuses out of whole cloth. Rather, inventions are often re-combinations of a variety of pre-existing innovations in a novel way that are practical and efficient. We should give praise to the people who made the litany of small contributions and improvements before the invention, but also recognize that the credited inventor(s) usually made a contribution that was more than the sum of the components.
To use a different example less culturally connected to our time, the ideas of differentiation and integration (they weren't necessarily called this) were fairly well-known before Newton and Leibniz. Those two independently recombined the existing knowledge into a simpler formulation (the fundamental theorems or calculus) and thus get the credit. They made these two concepts highly useful. Yet neither of them could have done his work without thousands of mathematicians who made small mathematical discoveries or inventions in the millennia before them.
Or in another example, Jim Keller recently said that "Moore's Law" is not a result of one set of principles applied repeatedly over the decades, but a result of probably hundreds of individual innovations.[1]
I personally think we should credit teams of people, but perhaps list the inventor who was most successful at producing the technology economically at scale with primary credit.
[1] https://www.youtube.com/watch?v=Nb2tebYAaOA&t=1805s