The possibility of amniotic fluid being flavored by the foods a mother eats is wild! Makes sense, but it is not something normally mentioned anywhere. It turns out that in the last few years a few studies were published that looked at foods flavoring the amniotic fluid and breast milk, and which later influence the flavors and foods a child prefers.
Research finds that at least some of the foods (e.g., alcohol, anise, carrot, garlic) that a mother eats during pregnancy flavors the amniotic fluid and breast milk, and then these foods or flavors are more accepted during infancy and childhood. During the period a mother breastfeeds, there is evidence babies detect the flavors of alcohol, anise/caraway, carrot, eucalyptus, garlic, mint, a variety of vegetables, peaches, and vanilla. Foods with these flavors appear in breastmilk soon after eating them - within 1 hour!
The few studies done all found greater acceptance and willingness to eat foods in infancy and childhood that had flavors the children were exposed to during pregnancy and/or when nursed. The overall thinking of researchers Spahn and others is that the mother's diet during pregnancy and lactation provides "the earliest opportunity to positively influence child food acceptance and preferences."
Of course the studies are limited in that only a few flavors are looked at in each study. But thinking about it - of course that is how a child accepts new flavors. It's the exposure and getting used to them. Formula always tastes the same, but breast milk varies a little every day! Some researchers suggest that there may be a critical period early in life where exposure to sour and bitter tastes (e.g., broccoli) can be made palatable to the baby. [scroll down to study #3]
These results also support not giving bland and unappetizing single flavor foods in baby jars to babies - instead give them the actual foods the parents are eating! Mash it with a fork, or even use a blender or food mill, but give them the real foods, flavored how the parent likes it. After all, they've already been exposed to those tastes.
The following 3 studies discuss this topic in more detail:
1) A group of researchers reviewed studies related to the topic of the mother's diet during pregnancy and lactation (breastfeeding), amniotic fluid flavor, breast milk flavor, and children's food acceptability. From the American Journal of Clinical Nutrition (2019): Influence of maternal diet on flavor transfer to amniotic fluid and breast milk and children's responses: a systematic review
Limited but consistent evidence indicates that flavors (alcohol, anise, carrot, garlic) originating from the maternal diet during pregnancy can transfer to and flavor amniotic fluid, and fetal flavor exposure increases acceptance of similarly flavored foods when re-exposed during infancy and potentially childhood.
Moderate evidence indicates that flavors originating from the maternal diet during lactation (alcohol, anise/caraway, carrot, eucalyptus, garlic, mint) transmit to and flavor breast milk in a time-dependent manner. Moderate evidence indicates that infants can detect diet-transmitted flavors in breast milk within hours of a single maternal ingestion (alcohol, garlic, vanilla, carrot), within days after repeated maternal ingestion (garlic, carrot juice), and within 1–4 months postpartum after repeated maternal ingestion (variety of vegetables including carrot) during lactation.
2) From the American Journal of Clinical Nutrition (2017): Learning to like vegetables during breastfeeding: a randomized clinical trial of lactating mothers and infants
The current study builds on the evidence base that mammalian infants learn about the food environment in which they live and their mothers’ diet during breastfeeding (13, 14, 39) and provides further evidence that there is a period during early life when the hedonic response to food flavors experienced in mother’s milk can be enhanced. Infants whose mothers drank a variety of vegetable juices, including carrot juice, were more accepting of cereal that was flavored with carrot juice (as determined by intake and rate of feeding) than were infants in the control group whose mothers drank water and avoided intake of the same vegetables.
One month of exposure was more effective when it began at 0.5 mo postpartum than when it began at either 1.5 or 2.5 mo postpartum, which indicated a timing effect. In infants whose lactating mothers began drinking the juices shortly after birth (2 wk postpartum), those whose mothers drank the juices for 1 mo were more accepting of carrot-flavored cereal than were infants whose mothers drank the juices for 3 mo, thereby indicating that the duration was less important than the timing. But regardless of when and how long the flavor exposure were, infants in each of the exposure groups displayed fewer faces of distaste during the early parts of feeding than control infants did, which indicated that there was a shift in the hedonic tone of the carrot-flavored cereal.
3) This article was about trying to understand the factors that influence flavor preferences in humans (whether salty, bitter, sweet, umami). They found that both genetic and what the baby experiences influences later flavor preferences. From Digestion (2011) - Flavor Perception in Human Infants: Development and Functional Significance
Flavor Learning: Prenatal Life
...The sensory environment in which fetuses live, the amniotic sac, changes as a function of the food choices of the mother since these foods flavor amniotic fluid . Experiences with such flavors lead to heightened preferences for these flavors shortly at birth [22,23] and at weaning . In an experimental study, infants whose mothers were randomly assigned to drink carrot juice during the last trimester of pregnancy enjoyed carrot-flavored cereals more than infants whose mothers did not drink carrot juice or eat carrots . Thus, like other mammals, prenatal experiences with food flavors transmitted from the mother's diet to amniotic fluid lead to greater acceptance and enjoyment of these foods during weaning.
Postnatal Flavor Learning via Infant Formula
Flavor learning continues after birth as a consequence of exposure to commercial infant formulas and/or to breast milk. Studies of formula feeding allow us to precisely control sensory experiences of the infant, and through this research we have demonstrated there is a sensitive learning period in the first several months of life during which unpalatable flavors (to those not familiar with them) can be rendered palatable.
This body of research has randomized infants to feed either standard commercial cow milk formulas (CMF) or extensively protein hydrolysate formulas (PHF) since these formulas differ enormously in flavor. In particular, the flavor of PHF is extremely unpleasant to those unfamiliar with them, having a bitter and sour taste, and a nauseating smell and aftertaste, perhaps because many amino acids taste sour and bitter . Infants less than 3–4 months of age who have never been exposed to hydrolyzed casein formulas (HC) readily accept them and appear not to dislike them as determined both by their willingness to consume them and by the absence of characteristic facial responses of rejection when being fed them [26,27]. In marked contrast, infants over 5–6 months of age with no experience with HC formulas strongly dislike and reject them [26,27].
Among infants tested prior to being introduced to table foods, experiences with flavors in formula impact on preferences for the taste qualities in food. Infants feeding PHF ate larger amounts of infant cereals that tasted savory, sour and bitter, and ate them at a faster rate than those fed milk-based formulas . That they liked the savory- and bitter-tasting cereals is indicated by the fewer facial expressions of distaste displayed during feeding. When compared to CMF, and presumably breast milk [31,32], PHF formulas have more pronounced savory, bitter and sour tastes and stronger odors . Thus, infants who regularly feed PHF have more experiences early in life during sensitive periods with these taste and flavor qualities which impacts on later food choice.
The effects of formula-based flavor experiences are long-lived. Four- to 5-year-old children who were fed PHF during infancy exhibited more positive responses to foods and beverages characterized by sensory attributes associated with them (e.g. sour taste, aroma, chicken, broccoli) when compared with same-aged children without such experience [33,34].... In other words, the characteristic flavor of the formula experienced in early life is ‘imprinted’ and remains as a preference for a considerable time.
Postnatal Flavor Learning via Human Milk
We believe that the principles revealed in studies with controlled exposures to infant formulas apply directly to the natural breastfeeding situation. Human milk contains not only nutrients such as carbohydrates, proteins, vitamins and minerals, but also flavors which are derived from the foods, spices and beverages ingested or inhaled (e.g. tobacco) by the mother [20,24,36,37,38,39]. In this regard, the natural feeding experience of the breast-fed infants is characterized by a great variability of flavor experiences that depend directly on the dietary choices made by the mother. For example, when nursing mothers consume garlic, vanilla or many other flavors, their milk becomes recognizably flavored and these flavors are detected by the nursing infant. Thus breast-fed infants experience flavor compounds from the foods and beverages that the mother has chosen to consume, and these experiences influence the infants’ subsequent liking and acceptance of these flavors in foods as has been reported for other mammals [40,41,42].
In a related study, breast-fed infants were more accepting of peaches than formula-fed infants, as determined by intake, rate of consumption and facial expressions. This enhanced acceptance of fruit was likely due to more exposure to fruit flavors since their mothers ate more fruits during lactation . We suggest that breast-fed infants learn to prefer flavors associated with fruits and vegetables by experiencing these flavors in mothers’ milk. This highlights the importance of a varied diet for both pregnant and lactating women. This variety of flavor experiences during early ontogeny may be the reason that, compared to formula-fed infants, breast-fed infants are less picky  and are more willing to try new foods .