首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将更多产品添加到wordpress商店后,graphql失败

问将更多产品添加到wordpress商店后,graphql失败
EN

Stack Overflow用户
提问于 2021-09-03 12:04:24
回答 2查看 91关注 0票数 0

有人知道如何修复这个graphql错误吗?它出现在我添加了更多的伍德科尔斯产品之后。Url似乎很好,因为删除了部分木头后,一切都恢复正常。

代码语言:javascript
复制
ERROR 

timeout of 30000ms exceeded


 ERROR #gatsby-source-wordpress_111006 

 gatsby-source-wordpress  It took too long for https://my-web-url/graphql to respond (longer than 30 seconds).

Either your URL is wrong, you need to increase server resources, or you need to decrease the amount of resources each
request takes.

You can configure how much resources each request takes by lowering your `options.schema.perPage` value from the default
of 100 nodes per request.
Alternatively you can increase the request timeout by setting a value in milliseconds to `options.schema.timeout`, the
current setting is 30000.

GraphQL request to https://my-web-url/graphql failed.
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-09-13 08:46:04

要解决此问题,您需要通过添加选项模式来提高gatsby-config.js文件中的超时时间。options: {schema: { timeout: 1000000,},}

但是仅仅这样做可能是不够的,因为你的wordpress服务器要么已经超载,要么很快就会超载。您需要在您的wordpress服务器中提高已分配的内存。你可以使用像filezilla这样的FTP软件,并将这一行添加到wp.config文件中。define( ‘WP_MEMORY_LIMIT’, ‘512M’ );如果你没有那么多的数据,你应该选择较小的数据,比如256MB。

票数 0
EN

Stack Overflow用户

发布于 2021-09-03 12:15:02

输出是不言而喻的。由于需要获取更多数据,您已达到超时阈值。

按照提示,您可以向gatsby-sourde-wordpress添加一堆options来自定义该限制:

代码语言:javascript
复制
{
  resolve: `gatsby-source-wordpress`,
  options: {
    schema: {
      timeout: 30000,
    },
  },
}

默认情况下,timeout采用30000ms的值。

此外,您还可以更改按页拉取的节点数(perPage)。

混合两种定制:

代码语言:javascript
复制
{
  resolve: `gatsby-source-wordpress`,
  options: {
    schema: {
      timeout: 30000,
      perPage: 100,
    },
  },
}

尝试增加这些缺省值,看看请求是否成功。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69044658

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档