【问题标题】:gatsby-source-graphql + ACF fields not showing upgatsby-source-graphql + ACF 字段未显示
【发布时间】:2020-04-20 02:07:01
【问题描述】:

我想知道为什么我的 ACF 字段没有显示在使用 gatsby-source-graphql 插件的 gatsby 应用程序中?我的 ACF 字段在我使用 WP 插件时显示:WP GraphiQL,但在我运行我的 gatsby 应用程序时不显示。我只能使用 gatsby-source-wordpress 导入 ACF 字段吗???其他一切似乎都出现了。我有一个使用没有问题的自定义帖子类型,但 ACF 字段是问题所在。任何帮助都会很棒,谢谢, 斯宾塞

它们出现在 WP 后端:

但在 Gatsby 运行时不要出现:

这是我的 Gatsby 配置中的内容:

{
      resolve: `gatsby-source-graphql`,
      options: {
        // This type will contain remote schema Query type
        typeName: `WPGraphQL`,
        // This is field under which it's accessible
        fieldName: `wpgraphql`,
        // Url to query from
        url: `http://wpgraphql.local/graphql`,
      },
    },

【问题讨论】:

    标签: wordpress graphql advanced-custom-fields gatsby wp-graphql


    【解决方案1】:

    看起来我所要做的就是删除 Gatsby 中的 .cache 目录并重建!

    【讨论】:

      【解决方案2】:

      添加,我建议运行yarn develop --verbose。在我的类似情况下,我注意到它在终端上输出了一个警告,该警告与请求因自签名证书而被阻止有关。

      【讨论】:

        猜你喜欢
        • 2019-10-26
        • 2020-07-23
        • 2020-08-11
        • 2022-11-19
        • 1970-01-01
        • 2021-08-18
        • 2020-11-26
        • 1970-01-01
        • 2021-05-08
        相关资源
        最近更新 更多