Just wondering what, in your opinion, makes a gay character work in a piece of fiction, and what makes the writing not work as a work of art? Give me your thoughts and opinions.
Gay characters "work" when they make sense in the story.
In most of my stories, since the 80s, there has been at last one gay or bi character - in general just because that reflected the real world as I experienced it.
They "fail" in a piece of fiction if being gay is their most important trait, the only thing that defines them, rather than being part of who they are.
The writing is always a work of art - it just isn't always a
good one and can be seen as an annoyingly preachy one if it seems to glorify gay relationships and denigrate traditional ones or makes the character just a bit too flamboyant and stereotypical (I remember comments from the first run of the TV series "Will and Grace" from LGBTQ people who said "After two episodes, we're pretty sure the actor playing Will is not gay, and really wish he were, while we also suspect the one playing Jack is not gay and doesn't even know anyone who is, just tries to be over the top on every gay stereotype.").
A story I wrote in the mid 90s had one of my favorite character interactions. Two superheroes, one a Batman-like lesbian (before the modern take on Batwoman came out ... literally and figuratively ... by almost a year IIRC) who is also a doctor and a skater, and who met the other character, a British "ladies' man" with powers very similar to The Thing except he can turn them on and off, when he made his costume. He's never seen her out of costume and sees her skating a few days before Christmas.
He stops to admire her - she had qualified for the Olympics when her parents' deaths made her give up those dreams and go into medicine, but never stopped practicing to stay in shape - and hit on her when she's done.
"I'm sure your very charming, and not bad looking," Susan replied, "But... well, I'm a lesbian..."
"Oh!" Nate replied, flushing slightly. "I... I'm so sorry..."
"Don't be - I rather enjoy it. Well, this has been a nice chat, but I have to get to work. Good meeting you Nathan, and Merry Christmas."
"Oh, I rather doubt that," he replied, a slight twinkle in his eye.
"Oh? Why is that?" she paused packing up her things to ask.
"Because I'm Jewish!"
"Ah! Oh... I'm so sorry..."
"Don't be - I rather enjoy it. And a good day to you, ma'am."