我已经成功地使用gatsby-source-contentful
来获取数据,但是无法弄清楚如何使用markdownRemark
扩展有问题的查询,如官方gatsby-contentful-starter
所示。
我在gatsby-transformer-remark
中添加了gatsby-config.js
,运行了gatsby clean && gatsby develop
,但是在Graphiql中仍然看不到childMarkdownRemark
。
gatsby-config.js
:
module.exports = {
siteMetadata: {
title: 'Test Contentful and MarkdownRemark',
},
plugins: [
{
resolve: `gatsby-source-contentful`,
options: {
// spaceId: 'XXXXXXXXXXXX',
// accessToken: 'XXXXXXXXXXXX',
},
},
`gatsby-transformer-remark`
],
}
package.json
:
{
"name": "test-gatsby-contentful",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"gatsby": "^2.18.2",
"gatsby-source-contentful": "^2.1.62",
"gatsby-transformer-remark": "^2.6.37"
}
}