What if you published a book and no one cared? Unless the Democratic presidential race changes drastically, that may be the unhappy plight of several New York publishers who last year signed contracts for big books about that hot politician for whom all of America was clammoring, Sen. Edward Kennedy.

Houghton Mifflin and St. Martin's Press, for example, are racing to be first to place a Ted Kennedy book in the nation's bookstores. There may be few customers around to cheer the winner, but it looks as if Houghton Mifflin's entry, Kennedy: The Myth of Leadership, will be in stores by the end of May. Written by Boston University political scientist Murray B. Levin and former Jack Anderson associate T. A. Repak, the harsh look at Kennedy was written without benefit of an audience with the senator.

St. Martin's kinder biography of Camelot's heir, written by syndicated columnist Max Lerner, is titled Ted and the Kennedy Legend. Following the precipitous slide of Kennedy's campaign fortunes, Lerner tinkered with the manuscript, so the book is now expected to be published in June. According to his time with Kennedy and his family.

Then there's writer Dick Schaap, whose publisher recently rejected his completed manuscript about Kennedy. Schaap claims the publisher simply didn't want to pay for a book that might not sell now, and the matter may end up in court.

Taking a longer view is the duo that wrote The Rockefellers, Peter Collier and David Horowitz. They have a contract with Summit Books to chronicle the Kennedy dynasty from its beginnings to the lastest blasts from Edward Kennedy's bugle. Kennedy's immediate fate appears to have little to do with the Collier-Horowitz project -- their manuscript isn't due until the summer of 1982.