gatsby-plugin-advanced-sitemap
gatsby-plugin-advanced-sitemap copied to clipboard
Error querying gatsby-source-graphql plugin
I am using gatsby-source-graphql to query GraphCMS, which nests my data collections under the parent field graphCMS.
{
graphCMS {
projects(stage: PUBLISHED) {
slug
updatedAt
publishedAt
}
workshops(stage: PUBLISHED) {
slug
updatedAt
publishedAt
}
}
}
With no configuration, gatsby-plugin-advanced-sitemap creates a single sitemap-pages.xml that gives me a 404.
I also can't figure out how to map nested data sources, since there's no way to destructure (or perhaps there is?). Nesting objects won't work.
{
mapping: {
graphCMS: {
projects: {
sitemap: 'projects',
},
workshops: {
sitemap: 'workshops',
},
},
},
}
Anyway to reproduce this? Seems like a wrong query request. As this plugin expects a node or edges.
It's a little hard to replicate, unfortunately.
As this plugin expects a node or edges.
…seems to be the issue. I'm fairly new to graphql so I've got to wrap my head around this.
Is there a way around this? Can't the plugin take nodes 2 levels deep? Perhaps it's possible to configure gatsby-source-graphql to expose projects and workshops top-level without nesting them under the graphCMSedge.