Gatsby start fetching certain fields when you deep populate query in the gatsby-config like this
{
resolve: "gatsby-source-strapi",
options: {
apiURL: process.env.STRAPI_API_URL || "http://127.0.0.1:1337",
accessToken: process.env.STRAPI_TOKEN,
collectionTypes: [
{
singularName: "article",
queryParams: {
publicationState:
process.env.GATSBY_IS_PREVIEW === "true" ? "preview" : "live",
populate: {
cover: "*",
blocks: {
populate: "*",
},
author: "*",
category: "*",
ending: "*",
},
},
},
{
singularName: "author",
},
{
singularName: "page",
queryParams: {
publicationState:
process.env.GATSBY_IS_PREVIEW === "true" ? "preview" : "live",
populate: {
sections: {
populate: "*",
},
},
},
},
though I have problem with fetching so-called dynamic zones like sections, which are here
populate: {
sections: {
populate: "*",
},
},
I suppose I need to deep query these sections that I need, but whenever I add smth in this part, build fails(
I tried configuring gatsby-node with customizingSchema, which also throws a build error and of course various methods how I could deep populate query in gatsby-source-strapi. Any ideas?
Vitalina Baryshpolets is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.