有人知道如何修复这个graphql错误吗?它出现在我添加了更多的伍德科尔斯产品之后。Url似乎很好,因为删除了部分木头后,一切都恢复正常。
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.发布于 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。
发布于 2021-09-03 12:15:02
输出是不言而喻的。由于需要获取更多数据,您已达到超时阈值。
按照提示,您可以向gatsby-sourde-wordpress添加一堆options来自定义该限制:
{
resolve: `gatsby-source-wordpress`,
options: {
schema: {
timeout: 30000,
},
},
}默认情况下,timeout采用30000ms的值。
此外,您还可以更改按页拉取的节点数(perPage)。
混合两种定制:
{
resolve: `gatsby-source-wordpress`,
options: {
schema: {
timeout: 30000,
perPage: 100,
},
},
}尝试增加这些缺省值,看看请求是否成功。
https://stackoverflow.com/questions/69044658
复制相似问题