Did the myth of the holy grail originate from Catholicism? Or its practices? Catholic church sanctioned holy wars suggest they didn't think the Holy Grail a myth back then.

The question is about its' origins, source.
Although the Grail folklore seems to stem from the same centuries as the crusades due to Arthurian legends. Here is a little insight to its' origins. The origins are a mix of cultures. The medieval Church took no official stance on Grail folklore.


  The Roots of the Holy Grail 
  
  Academic consensus gives the Grail a Celtic origin. The foremost campaigner for this view is Arthurian scholar Roger Sherman Loomis, whose book, The Grail: From Celtic Symbol to Christian Myth (1963), traces it to Irish tales of cauldrons and drinking horns that never run empty as well as accounts of journeys to the Happy Otherworld. The maiden Grail-bearer is based on the personified Sovereignty of Ireland, a woman who gives her cup only to the worthy. These elements were transmitted to Wales, then to Brittany, with Breton storytellers spreading them around northern France where the medieval romances first appeared. Loomis assumes that the material had been much altered by misunderstandings and oral process: There was no one "original" Grail myth.
  
  But it was the connection with the Holy Eucharist that fixed the Grail in medieval minds. The old myths might never have gained such popularity without the Christianization that brought them in line with medieval iconography and devotional practice. 
  
  Grail romances appeared just as Eucharistic devotion was gaining favor, expressed in the elevation of the Host during Mass, Corpus Christi processions, preachers' parables, and miracle stories. Hosts that levitate, bleed, discriminate among recipients, serve as the sole food of saints, and reveal visions of Christ appear often in Eucharistic miracles and in Grail adventures. Devout contemplation of the elevated or exposed Host was believed to convey not only grace but well-being and protection, as does an encounter with the Grail. 
  
  The medieval Church took no official position on Grail romances. But the cathedral of Valencia claims to possess the actual vessel, a red stone cup from the time of Christ mounted as a splendid chalice during the Middle Ages. Its legend — which owes nothing whatever to the romances — claims that it was sent to Spain by the Roman martyr St. Lawrence. Donated to the cathedral in 1437, it's kept in a special chapel and was once used for Mass by Pope John Paul II. - The Real History of the Holy Grail




Valencia Chalice


  Pope John Paul II himself celebrated Mass with the Holy Chalice in Valencia in November 1982. In 2006 at Valencia, Pope Benedict XVI also celebrated with the Holy Chalice, on this occasion saying “this most famous chalice”, words in the Roman Canon said to have been used for the first popes until 4th century in Rome, and supporting in this way the tradition of the Holy Chalice of Valencia. - The Holy Chalice of Valencia: Is it the Holy Grail?