Querying and formatting the data for 11ty
Adding data via the
addGlobalData method on the
eleventyConfig option will add global data to our cascade that we can use with the added benefit of allowing this to be added to a plugin, as we’ll discover in the next chapter.
addGlobalData method accepts two arguments: a string to create the data key, and a function to return the data. In this case, we’ll call our data
hygraph and use an async function to fetch that data:
eleventyConfig.addGlobalData("hygraph", async function...