【问题标题】:Gridsome/Netlify CMS docs lead to broken GraphqlGridsome/Netlify CMS 文档导致 Graphql 损坏
【发布时间】:2020-08-07 02:25:12
【问题描述】:

我无法通过关注 Gridsome 的 docs 来使用 NeflifyCMS 设置 Gridsome

设置 Netlify config.yml 的片段

collections:
  - name: "posts"
    label: "Posts"
    folder: "posts"
    create: true
    slug: "{{slug}}"
    fields:
      - {label: "Title", name: "title", widget: "string"}
      - {label: "Excerpt", name: "excerpt", widget: "string"}
      - {label: "Publish Date", name: "date", widget: "date"}
      - {label: "Body", name: "body", widget: "markdown"}

我去 Graphql Playground 并打开 Docs 选项卡并查看“allPost”查询,但是当我查看它内部时,“title”未被识别为 post 下的字段,但由于某种原因“belongsTo”是。如果您尝试查询“title”,您将收到错误“Cannot query field 'title' on type 'Post'”。

我不知道“belongsTo”从何而来,也不知道如何解决。这是 Netlify 错误还是 Gridsome 问题?

【问题讨论】:

    标签: javascript vue.js netlify netlify-cms gridsome


    【解决方案1】:

    长话短说文档有误,请观看此视频https://www.youtube.com/watch?v=ryP1RMA7P9Y

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多