Once, during an on stage discussion of the type literary festivals go in for, I frightened Neil Gaiman by channelling the voice of the Wicked Witch of the West from the film The Wizard of Oz. “And your little dog, too!” I cackled. “No! No! Don’t do that!” cried Neil. He then explained that he had been petrified by this green-tinted witch as an eight-year-old. Behold: a literary influence had been discovered!

The best children’s writers are, somewhere deep in their psyches, still eight years old. They know what is scary. They remember what it was like to have your hand plunged into a Halloween bowl of peeled grapes in a darkened room, having been told they were eyeballs. They relish the delights of being terrified in song and story. They understand the benefits of imaginary horror: yes, this is frightening, but ultimately it can be dealt with, at least in fictional form.

Gaiman brought himself up right. He read a great many books proper to his future calling, and absorbed their memes and lessons. When advised to direct his feet to the sunny side of the street, he did – he does not write tragedies – but he also directed them to the shadow side; for, as Ursula K Le Guin so memorably put it: “Only in silence the word, / Only in dark the light, / Only in dying life: / Bright the hawk’s flight / On the empty sky.” Or as Beatrix Potter demonstrated, no fun robbing the radishes from Mr McGregor’s garden unless the rabbit-pie dish hovers as a threat. What’s the point of being “Alive, alive, oh” unless you also risk being dead as a doorknob? (Though we must reserve judgment about those doorknobs, in view of A Christmas Carol.)

Facebook Twitter Pinterest Illustration from Neil Gaiman’s The Graveyard Book by Chris Riddell.

Astrologically, Gaiman is a Scorpio with Gemini rising and, if you go in for that sort of thing – as he must, because I found his horoscope online – this explains much. Scorpio is governed by Pluto, patron of the Underworld as well as of plumbing, underwear, the criminal underworld and everything below the line. Gemini is ruled by Mercury or Hermes: god of thieves, jokes, communication, travel and secrets; in addition to which he is the conductor of souls to the Underworld. Most travel to the land of the dead is one-way, but Hermes comes and goes as he pleases, and so do various protagonists in books by Gaiman, including The Graveyard Book.

Most of us have a distinct aversion to being dead. We have great difficulty imagining ourselves as simply not existing any more: even the sentence “I will be dead” contains an “I”. So where will the “I” be when the “dead” phase kicks in? There have been a great many answers to that question over time: in a dusty underworld (Mesopotamia); in a complex, many-chambered afterlife, supposing your heart passes its weighing-in test against the Feather of Truth (ancient Egypt); in the asphodel-bestrewn but tedious Elysian Fields, if a Greek hero; in Hell, Purgatory, Paradise or Heaven, if an early-Renaissance Christian; in the territories of the dead after your journey on the three-day road (indigenous North America), or in the inventive goth worlds of Tim Burton, such as the one in Corpse Bride; or in the frolicsome Mexican Day of the Dead realm of the recent Pixar film Coco.

But there are many other possibilities. You could – for instance – become a vampire: neither alive nor dead. You could become a ghoul: alive in a way, but consuming dead bodies. Or you could become a ghost: there but not there, visible sometimes but invisible at other times, and frequently spotted in graveyards.

It is this latter body of folklore that Gaiman draws on for The Graveyard Book. The hero of his tale begins as a toddler who climbs out of the window while his parents are being murdered and makes his way uphill to the neighbourhood cemetery, where some of the resident spirits – prompted by the fleeting appearance of his ghostly mother – elect to adopt him. Since they don’t know his name, they call him “Nobody” (“Bod” for short), reminding us of the ruse practised by the wily Ulysses during his escape from that pesky Cyclops. So useful to be able to answer “Nobody” when asked who you are.

The graveyard in question is very old and contains many layers of time – Celtic, ancient Roman, many centuries of English – so Bod learns different kinds of writing from the tombstones and a lot about history from the inhabitants. There is a misadventure when he tries to go to a real school – he doesn’t exactly fit in – but his persecutors are satisfactorily foiled.

It’s customary for heroes to be educated in unorthodox ways – by a centaur, for instance, like Achilles, or by a wizard, like King Arthur. It’s also not unusual for them to have dead parents and strange powers, like Harry Potter.

The Graveyard Book is a bildungsroman – a novel about a protagonist’s education – in which Nobody’s unusual tutors are a collection of ghosts, a vampire and a female werewolf, and the strange powers are supernatural abilities granted by the dead people who live (as it were) in the graveyard.

Play Video 8:56 Neil Gaiman reads an excerpt from The Graveyard Book – audio

This situation has come about because of the deadness of Nobody’s parents at the hands of a collection of arch enemies, all of whom are called Jack, though with different surnames. They are the “jacks of all trades” – Jack Tar, Jack (Be) Nimble, Jack Frost … The other term for a “Jack” in a deck of cards is a knave, and a knave can also be a villain. And so it is in The Graveyard Book, for the Jacks belong to an ancient and powerful order, and Nobody is one of those fabled children tagged by a prophecy – in his case a prophecy that he will mean the end of the Jacks. You can see why they would seek to put an end to him.

But when you have as a guardian a suave vampire like Silas – boundary keeper of the graveyard and obliterator of memories, and able to come and go between worlds, and thus go food shopping – and when said vampire has a backup in the person of an eastern European werewolf called Miss Lupescu, a formidable ally despite her penchant for borscht, then the pro-Bod and anti-Bod forces are more evenly balanced.

Will the Jacks find and slaughter Bod before he has grown up enough to be able to foil them? Will the forces of Good-Goth prevail over the forces of Bad-Goth? Will you have as much fun reading this book as Gaiman obviously had while writing it? Of course you will! Will you shed a surreptitious tear during the danse macabre, when the living dance with the dead under the patronage of Death herself, but poor Silas the vampire is excluded, being neither one nor the other? Yes, you will.

The Graveyard Book has that many-layered quality so prized in the best children’s books: gripping for eight-year-olds, but with deeper shades and resonances for older people. It’s a true pleasure, from beginning to beginning – for our hero must eventually conclude his education, and graduate from death to life.

• Neil Gaiman’s The Graveyard Book is published by Bloomsbury. To order a copy for £8.59 (RRP £9.99) go to guardianbookshop.com or call 0330 333 6846. Free UK p&p over £10, online orders only. Phone orders min p&p of £1.99.