"I thought it was a myth."
"One would think, after seven years, you'd stop saying that out loud."
"Well, how am I supposed to know? There isn't a book, is there? All the Magickal Things that Are Actually True and All the Ones that Are Bollocks, Just Like You Thought."
"You're the only magician who wasn't raised with magic. You're the only one who would read a book like that." [loc. 834]
In Fangirl, Rainbow Rowell wrote about fanfiction, and a girl named Cath who was obsessed by the fictional world of a best-selling series, featuring tyro wizard Simon Snow, evil-seeming Baz Pitch, and their doomed, swoony romance. (The romance, of course, does not feature in the original series, but it is the focus of Cath's fanfic.) Cath was writing a novel-length fic called 'Carry on, Simon', which she was desperate to publish before the final book of the canonical series came out.
So: Carry On. I'm pretty sure it's not intended to be the fanfic that Cath wrote: the style is more that of Cath's favourite author, Gemma T Leslie, than of Cath herself. It is not much like J K Rowling's style, either, though Rowell would be the first to admit that Fangirl is largely based on the phenomenon that is Harry Potter fandom. Carry On's hero, Simon Snow, is definitely a Chosen One: the Mage, who never seems to tell him what he wants to know, has been guiding and shaping Simon's life since he was eleven, moving him from one children's home to the next during summer holidays. Simon's arch-enemy, Baz Pitch, is sophisticated and sneery and very probably a vampire. Penny, Simon's best friend, is Anglo-Indian. ("I didn't know someone like you could be named Penelope", Simon recalls saying to her, 'stupidly', when they first met). Agatha, Simon's girlfriend (or is she Baz's?), is gorgeous and very girly.
Rowell's variation on the theme doesn't make as much of the politics of the magical-mundane divide as Rowling's: she does, however, address some of the issues that Rowling doesn't focus on. For instance, the Mage's treatment of Simon is depicted as more problematic than Dumbledore's behaviour towards Harry; the elitism of the wizarding world is questioned by several characters; Agatha is less of a cipher than Ginny Weasley, and more of an independent character with agency of her own. Perhaps most tellingly, Simon's nemesis -- the Humdrum, a force that leaves holes in the intrinsic magic of the land -- is intimately connected to Simon himself. Correlation or causality?
Instead of focussing on one character's narrative, with reportage of events at which he's not present, Rowell tells her story from several different first-person viewpoints: Simon, Penny, Agatha, Baz, the Mage, the mysterious Lucy. And though there is plenty of backstory -- Carry On is framed as the final novel in an eight-book series -- it's sketched in lightly, by allusion rather than flashback or laboured 'do you remember' exchanges.
I did enjoy Carry On: it's astutely observed, often very funny and has a fascinating system of magic based on catchphrases and cliche. I'd probably have enjoyed it more, and in different ways, if I were a bigger fan of the Harry Potter franchise. However, it did prompt me to read some HP fanfic!