reactjs - Gatsby 似乎沒有抓取某些欄位
當你在 gatsby-config 中如此進行深度關聯查詢時,Gatsby 開始抓取某些欄位
{
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: "*",
},
},
},
},
雖然我在獲取所謂的動態區域(如這裡的 sections)時遇到問題
populate: {
sections: {
populate: "*",
},
},
我想我需要深入查詢我需要的這些部分,但每當我在這部分添加某些東西時,構建就會失敗(
我嘗試過使用 customizingSchema 配置 gatsby-node,這也會導致構建錯誤,當然還有各種方法可以在 gatsby-source-strapi 中深度填充查詢。有人有想法嗎?