gatsby-source-contentful无法与gatsby-transformer-remark一起使用

时间:2019-11-24 20:55:42

标签: graphql markdown gatsby contentful

我已经成功地使用gatsby-source-contentful来获取数据,但是无法弄清楚如何使用markdownRemark扩展有问题的查询,如官方gatsby-contentful-starter所示。

我在gatsby-transformer-remark中添加了gatsby-config.js,运行了gatsby clean && gatsby develop,但是在Graphiql中仍然看不到childMarkdownRemarkenter image description here

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"
  }
}

Reproduction repo

0 个答案:

没有答案