When it comes to publishing, trends can be your best friend or your worst enemy. Sometimes a book will get really hot and there will be a honeymoon period where everyone is looking for that type of book. Then the market gets over-saturated and nobody wants it.
YA dystopia is the best example of this that I can think of. Obviously, The Hunger Games was a mega success. In it’s wake followed Divergent, The Maze Runner, Matched, Legend, The Selection, and Delirium. All books that did very well, and that’s not a comprehensive list.
So if you happened to be querying a dystopia just as Hunger Games was taking off, you had a nice advantage. Everyone wanted books like that. Now, everyone is over the craze. I won’t say YA dystopia never sells anymore, because I think it still does. Especially if the premise is unique. But it is hard to sell.
I don’t really believe you can write towards trends. Contemporary is hot right now, but if you were to start writing contemporary today, the fad would probably be over before you have a chance to query (which, again, isn’t to say they’ll stop publishing contemporary. But it won’t be the hot thing anymore).
Basically, write what you love. And if you hit the downward end of a trend, write another book (always write another book). Save the first one for when that particular type of book rolls back into style (genres are sort of like fashion that way. Remember when 80s styles were suddenly in vogue again? And now 50s vintage is all the rage? I think. I don’t actually know that much about clothes).
And don’t worry if you’re book isn’t in the genre that’s hot either. Maybe everyone says they’re looking for a certain thing, and your book isn’t that thing. That’s okay. Agents and editors aren’t usually looking exclusively for one thing. They’re looking for what’s hot right now, but also for the next big thing. And sometimes they don’t even know they’re looking for something until they find it.
So basically, screw trends. Just keep writing.