A prolific writer, Kipling wrote actively across several broader genres, including fiction, poetry, and journalism. Within fiction, he wrote both novels and short stories. His fiction falls into a range of subgenres, including science fiction, adventure fiction, spy stories, children's literature, historical fiction, and war literature. "The Gardener" belongs most firmly to the latter two of these categories.
Set in the years surrounding World War I, the story illustrates the sudden loss that many families experienced during those years, as well as the feeling of senselessness that accompanied this loss. While the narrator doesn't go into great detail about events on the battlefield, there are nevertheless mentions of major World War I battles, including Loos, the Somme, Armentières, and Ypres. Rather than narrowing in on the battlefield experience, however, this war story considers the experience of those at home—many of whom are eventually left behind. The much-elaborated-upon image of the cemetery at the end stands in for the many battlefields of the war. The story also belongs to the genre of historical fiction, in that it gives the reader insight into a major event in world history.
An element that is relevant to a discussion of the genre is the story's epigraph. By way of this epigraph, the story contains one of Kipling's own poems, which is also about the war. A nod to the many genres Kipling associated himself with, this poem-within-a-story reminds the reader that an immense amount of literary works have been written and published about World War I. Nevertheless, many (and likely Kipling among them) would argue that no amount of writing can succeed in fully capturing the war's barbarity, grief, and senselessness.