“I felt like, if we don’t tell a story about a Muslim guy falling in love with a white woman and her falling into a coma, nobody’s gonna tell it,” said Kumail Nanjiani, grinning.

Some movies feel like life, and sometimes life feels like a movie — and sometimes, both are true. Such is the case with “The Big Sick,” which stars Nanjiani and was written by him and his wife, Emily V. Gordon, based on the undeniably dramatic story of their own courtship. It’s the kind of tale at which you might raise an eyebrow — surely some melodramatic screenwriter made this up? — except that it happens to be true, right down to the happy ending. The movie, which is emotional and moving and often very funny, premiered at the Sundance Film Festival in January and was acquired for distribution by Amazon Studios.

About 10 years ago in Chicago, the Pakistani-born Nanjiani — then a struggling stand-up comedian — met Gordon, who’d just finished graduate school and was working as a therapist. Sparks flew, but not without worries: Nanjiani’s conservative Muslim family, who had followed him in relocating to the United States, expected him to enter a traditional arranged marriage, so he hid the relationship from them. Suddenly, Gordon became seriously ill, and as she lay in a medically induced coma, Nanjiani had to make a choice between tradition or love.

Fast-forward to May 2017 (spoiler alert: she’s doing well now) and the now-married couple, in town for the film’s opening-night screening at the Seattle International Film Festival, are sitting side-by-side, finishing each other’s sentences, giggling appreciatively at each other’s stories (he seemed amused to hear that she was president of her high school’s Thespian Society), and generally seeming every bit as charming as the movie presents them to be.

Nanjiani’s now a familiar face — he stars as coding whiz Dinesh on HBO’s “Silicon Valley,” and has appeared in numerous movies. Gordon is now a writer and television producer. But they never thought of writing a movie together, until Judd Apatow, hearing their story, encouraged Nanjiani to develop it for the screen. (Apatow ultimately became its producer.)

“I was giving (Kumail) notes on the first draft, and we were just kind of like, ‘We should probably write this together,’” Gordon said. Though she was initially reticent — “I’m definitely more private about that kind of stuff” — she quickly came around to the idea of sharing their history. “Not only do I like how it turned out,” she said, “but it goes from being your story to being a story that you’re creating with other people. It slowly became a thing that felt less like mine and more like it kind of belonged to everybody.”

To write the screenplay, the two took a divide-and-conquer approach. “If it was a scene with me and my family, I would do the first draft; if it was from Emily’s perspective, she would do the first draft,” Nanjiani said. “Then we would trade and rewrite.”

For both of them, it was a slightly surreal experience: Nanjiani was revisiting deeply emotional, traumatic days; Gordon, unconscious for a large chunk of the story, had no memories of what occurred. “Emily doesn’t literally know the rhythm of those days,” said Nanjiani, remembering endless hours spent at the hospital. “This weird community develops in the waiting room. The patients don’t know each other, but the families all know each other.”

Gordon “did a lot of checking” with her parents and husband, to fill in those days; she also added her unique perspective. Everyone was overjoyed when she awoke from her coma, “but I was miserable!” she said, describing what it was like to wake up, feeling terrible, to discover what her life had turned into. “I’m normally kind of outgoing and brash, but then I was very meek and crying a lot,” she said.

And they needed to craft the characters of both sets of parents. Gordon’s parents were initially opposed to the idea of turning the experience into a movie — “My mom’s first reaction was, ‘I don’t know how that’s funny,’” Gordon said. “I think she thought it would be more slapstick. I told her, ‘Trust us, it was also very traumatic for us, we’re going to honor all that.’”

For dramatic purposes, the characters of Gordon’s parents were changed somewhat from real life. “My parents are very Southern, very sweet, they got along with Kumail quite well,” she said. Nanjiani’s parents were closer to their actual counterparts. “My dad loves telling jokes,” Nanjiani said. “I have a very gregarious family. In fact, some of the (funny) lines in the movie are exactly lines from my parents.”

With the script finished, attention turned to casting. Nanjiani would play himself — or, rather, a slightly younger version of himself. Gordon, not an actor (despite her Thespian Society credentials), said “it was never even discussed” that she would play Emily. With her blessing, Zoe Kazan was cast as Emily, and Gordon was emphatic that she didn’t want Kazan to do an impression of her.

“Nobody knows who I am, so who cares if she’s doing an impression of me?” she said. “Zoe did such a great job in a situation that could have been quite strange but felt natural and comfortable.” The three of them became friends, and Gordon acknowledges that “we’re kind of similar people. On the first day (of shooting), I was wearing a shirt that Zoe also owns.”

The two were excited to have their families gather at the New York premiere in late June. Gordon said her parents had already seen the film (“they loved it”); Nanjiani said his hadn’t yet, but they were “very excited” about it.

“It’s the first thing I’ve ever done that newspapers in Pakistan have covered,” he said. “All the kids I went to high school with are getting in touch with me.”

And they’re not too worried about whether their presence on the interview circuit is giving away the movie’s ending. “You know, when you watch Indiana Jones movies, you know Indiana isn’t going to die,” Nanjiani said. “But he’s still in peril. You get caught up.”