【问题标题】:Gatsby-Source-Facebook-Graphql PluginGatsby-Source-Facebook-Graphql 插件
【发布时间】:2020-08-11 13:16:50
【问题描述】:

我无法使用这个插件在 graphql 中找到数据,我只能得到 FB id。

这是我的 gatsby 配置

{
      resolve: `gatsby-source-facebook-graphql`,
      options: {
        // Facebook account or page ID
        pageId: XXXXXX,
        params: {
          fields: [
            'address',
            'birthday',
            'hometown',
          ],
        },
        // Access Token from facebook
        accessToken: 'XXXXXX',
      },
    },

我知道我的访问令牌是正确的,因为如果没有它,facebook 就会从 graphiql 面板中消失。

提前致谢。

【问题讨论】:

  • 当您运行gatsby build 时,这些字段中的任何一个是否返回任何内容?您是否在终端中看到任何错误/警告? developers.facebook.com/docs/graph-api/reference/user
  • 不,这就是问题所在,我没有看到返回的数据。构建也没有错误。

标签: graphql gatsby


【解决方案1】:

我想通了,我需要为 FB API 添加正确的权限。

【讨论】:

    猜你喜欢
    • 2021-05-08
    • 2019-12-10
    • 1970-01-01
    • 2020-02-05
    • 2019-09-29
    • 2019-04-02
    • 2020-04-20
    • 2019-10-26
    • 2020-11-14
    相关资源
    最近更新 更多