Skip to content

gatsby-plugin-sitemap: restore the ability to pass additional query data  #22703

@abohannon

Description

@abohannon

Summary

It appears that with the latest version, the ability to pass additional data in the sitemap query was removed. Our sitemap is constructed using data from site, allSitePage and another query, but after updating our additional query data is no longer being returned. The issue seems to be with the explicit shape being returned on line 55 in internals vs. returning r.data as before.
07319d0#diff-a627f3ef3dc8b682479f174b8c29fc20

Basic example

The query we're using that no longer works is:

const sitemapPageQuery = `
{
  site {
    siteMetadata {
      siteUrl
    }
  }
  allSitePage {
    nodes {
      path
      context {
        index
        filterValue
      }
    }
  }
  allContentfulP0001Page {
    nodes {
      robotsMetaTags
      url
    }
  }
}
`

allContentfulP0001Page data comes back undefined.

Motivation

Being able to pass additional query data allows us to tailor the creation of our sitemap. It would be helpful if this feature could be restored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: confirmedIssue with steps to reproduce the bug that’s been verified by at least one reviewer.type: bugAn issue or pull request relating to a bug in Gatsby

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions