The Murdstone Trilogy, by Mal Peet
Not actually a trilogy.
Murdstone is an embittered, failing author who is also very good – at writing award-winning, uplifting, highly aware novels about special needs boys. Unfortunately the market for award-winning, uplifting, highly aware novels about special needs boys has collapsed and Murdstone’s agent suggests he tries his hand at high fantasy. Then, in his bathroom, he meets a strange goblin-like creature who wants the story of his kingdom told … I was afraid this one would descend into cheap shots at fantasy, but what makes it work is that the fleeting descriptions we get of the fantasy world and its history – like Granny’s fairy tales – make it clear they would be an absolutely cracking read in their own right.