There are various types of edible glue; such as royal icing, gum paste/water mixture, melted chocoloate, piping gel etc. Which glue you choose depends on each individual project. I would use royal icing to fasten the pieces of a gingerbread house together, for example, as it tends to be a strong adhesive. My favourite type of sweet glue is made with tylose powder. I've adapted
The BEST Edible Slime Recipes - Easy & Fun Homemade Slime
Using CMC to make edible glue, Hello, check out this video on how make edible glue using CMC, By Topserve Eldoret
2 Easy Ways To Make Edible Glue For Cake Decorations./Beginners Friendly.
How to make edible glue with sugar - Quora
Edible Tylose Glue - The Craft Crib
Satin Ice Edible Glue - 2 oz
How to Stick Fondant to Fondant - A Guide to Edible Glue
How to make Edible Sugar Glue - Casa Costello
How to Make Edible Glue for Gumpaste & Fondant Embellishments : 4