A late-night/early-morning work shift.
I am loath to do it, as there may just be someone who will take the following passage as literal truth, but here's a reprint of the last (and quite possibly the least) paragraph of the collection of invented and untrue twaddle that has been circulating on the Internet for some time, under the name of 'Life in the 1500s':
England is old and small and they started running out of places to bury people. So they would dig up coffins and would take the bones to a "bone-house" and reuse the grave. When reopening these coffins, one out of 25 coffins were found to have scratch marks on the inside and they realized they had been burying people alive. So they thought they would tie a string on the wrist of the corpse, lead it through the coffin and up through the ground and tie it to a bell. Someone would have to sit out in the graveyard all night (the "graveyard shift") to listen for the bell; thus, someone could be "saved by the bell" or was considered a "dead ringer."
We have debunked the saved by the bell and dead ringer myths previously, so now let's take a look at 'graveyard shift'. Given that the derivation of the phrases 'saved by the bell' and 'dead ringer' had nothing whatever to do with burials or graveyards, it might be thought that 'graveyard shift' could be dismissed without further investigation. That may be a little hasty. Those phrases may have had nothing to do with bells being attached to coffins to guard against premature burial, but such devices did exist and were occasionally used. Given that some people had sufficient fear of being buried alive to invest in such coffins, it is at least plausible that they would also have made arrangements for someone to monitor the grave so that their coffin's bell could be heard in the event of them ringing it. Nevertheless, and as usual with phrase etymology, plausibility and truth are only distant relatives.
The Graveyard Shift, or Graveyard Watch, was the name coined for the work shift of the early morning, typically midnight until 8am. The name originated in the USA at the latter end of the 1800s. There's no evidence at all that it had anything directly to do with watching over graveyards, merely that the shifts took place in the middle of the night, when the ambience was quiet and lonely.
The earliest example of the phrase in print that I have found is in the US newspaper The Salt Lake Tribune, June 1897:
The police changed shifts for the month yesterday. This month Sergeant Ware takes the morning relief. Sergeant Matt Rhodes the middle and Sergeant John Burbidge the graveyard shift.
The 'graveyard watch' version of the phrase was normally used by sailors on watch - hardly a group in a position to supervise buried coffins. The graveyard link was made explicit in this definition, offered by the American mariner Gershom Bradford, in A Glossary of Sea Terms, 1927:
"Graveyard watch, the middle watch or 12 to 4 a.m., because of the number of disasters that occur at this time."
One more nail in the coffin of folk etymology, let's hope, or can I still hear a faint bell clanking in the Internet graveyard?