function resolveSiteUrl(data) {
  if (!data?.site?.siteMetadata?.siteUrl) {
    throw Error(
      `\`siteUrl\` does not exist on \`siteMetadata\` in the data returned from the query.
Add this to your \`siteMetadata\` object inside gatsby-config.js or add this to your custom query or provide a custom \`resolveSiteUrl\` function.
https://www.gatsbyjs.com/plugins/gatsby-plugin-sitemap/#api-reference
      `
    )
  }

  return data.site.siteMetadata.siteUrl
}
@name resolveSiteUrl

@param {object} data - results of the GraphQL query
@returns {string} - site URL, this can come from thegraphql query or another scope