Adam Gidwitz, author of the “Grimm” novels, signs a copy of his new book, “The Inquisitor’s Tale,” in which three children try to save some sacred objects.

To learn how dogs think and act for his new novel, “The Inquisitor’s Tale,” Adam Gidwitz carefully watched the pooch that belonged to his wife’s parents. The labradoodle helped him create his character Gwenforte. But Gwenforte is no ordinary dog. The greyhound, who lives in France during the Middle Ages, can perform miracles.

“Why does Gwenforte have a golden Afro?” kids sometimes ask at Gidwitz’s book events. On the book’s cover, the greyhound actually has not an Afro but a halo, which looks like a circle of light behind someone’s head. In paintings, it shows that the person is a saint. The book’s illustrator, Hatem Aly, wanted his art to resemble the “illuminated manuscripts” created by medieval monks. The novel includes pictures of saints, knights and gargoyles!

Gidwitz got the idea for Gwenforte by reading the life story of a real 13th-century inquisitor who investigated stories about a saintly dog. He also read about Saint Joan of Arc, and the book’s peasant character Jeanne is loosely based on her. Jeanne can see into the future, and that puts her and Gwenforte in danger.

Sinister knights try to capture her, but she escapes. As they flee, she and the greyhound meet Jacob, a Jewish boy, and William, an orphan who lives in a monastery. William’s father was a knight in Spain and his mother was a Muslim from Africa.

“I wanted to explore the very different state of race relations in Medieval Europe,” Gidwitz says in the book’s author note.

Back then, there wasn’t prejudice against others because of the color of their skin, he said; most hatred and fear stemmed from religious differences.

Jeanne and Jacob confront that prejudice as they join William on his quest to save some sacred objects. They must deal with a farting dragon, an enraged queen and an inquisitor.

During the Middle Ages, an inquisitor’s job was to figure out whether a person or group was following Christian teachings, and to expose and destroy that person if they were not.

In the novel, the inquisitor collects tales about the children and the dog from other travelers. Slowly, he closes in on them.

Gidwitz learned about inquisitors and knights while on research trips with his wife. She is a professor of medieval history. Together they visited old monasteries and dungeons, and Gidwitz began recording interesting facts and ideas.

His favorite experience was “walking in the bay of Mont Saint-Michel,” he said in an email from his home in Brooklyn, New York. The bay off France’s northwestern coast is full of quicksand, and it plays an important part in the story.

At Hooray for Books in Alexandria on Tuesday, Gidwitz will talk about his new book, his popular “Grimm” novels, including “A Tale Dark and Grimm,” and his childhood in Baltimore.

As a kid, “I loved coming to D.C.,” Gidwitz said. His favorite things to do were eating astronaut ice cream at the National Air and Space Museum and enclosing himself in a giant bubble at the old Capital Children’s Museum.

MEET THE AUTHOR

Adam Gidwitz will speak and sign books.

Where: Hooray for Books, 1555 King Street, Alexandria.

When: Tuesday at 6:30 p.m.

How much: Free, but you need to register in advance by calling 703-548-4092. To receive a ticket for the book-signing line, you must buy “The Inquisitor’s Tale” from Hooray for Books.

How old: Age 8 and older.

For more information: A parent can visit hooray4books.com or call 7030548-4092.