【发布时间】:2020-08-05 01:21:35
【问题描述】:
我正在尝试为自己开发一个博客网站。我决定用 gatsby 和内容来制作它。我关注了这个tutorial
查询代码
query MyQuery {
allContentfulBlogPost {
edges {
node {
author {
name
}
createdAt
body {
body
}
title
featuredImage {
file {
url
}
}
}
}
}
}
输出:
"message": "Cannot query field \"featuredImage\" on type \"ContentfulBlogPost\".",
为什么 featuresImage 没有出现在 allContentfulBlogPost 中?我怎样才能找到它?
我的 gatsby-config.js 文件:
plugins: [
`gatsby-plugin-react-helmet`,
`gatsby-image`,
`gatsby-transformer-remark`,
{
resolve: `gatsby-remark-images`,
options: {
maxWidth: 740,
wrapperStyle: `margin-bottom: 2.2rem;`,
},
},
我已经添加了 gatsby-image 和 gatsby-remark-images 但它没有帮助。
如果您对此主题有任何想法,请回复。
任何回复将不胜感激
【问题讨论】: