reactjs - 向 woocomerce wordpress 商店添加更多产品后,graphql 失败
问题描述
有谁知道如何解决这个graphql错误?它出现在我添加了更多 woocomerce 产品之后。网址似乎很好,因为在删除了部分 woocomerce 产品后,一切都恢复正常工作了。
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.
解决方案
输出是不言自明的。由于添加了更多要获取的数据,您已达到超时阈值。
正如提示的那样,您可以添加一系列选项来自gatsby-sourde-wordpress
定义该限制:
{
resolve: `gatsby-source-wordpress`,
options: {
schema: {
timeout: 30000,
},
},
}
,timeout
默认情况下采用 30000ms 的值。
perPage
此外,您可以更改 page( )获取的节点数。
混合两种自定义:
{
resolve: `gatsby-source-wordpress`,
options: {
schema: {
timeout: 30000,
perPage: 100,
},
},
}
尝试增加这些默认值以查看您的请求是否成功。
推荐阅读
- c - 由中断服务例程切换的 volatile 变量的更改未反映在 main() 中
- linux - 使用内存映射IO时调用ioread函数有什么好处
- python - python pandas读取空格分隔的数据
- android - TypeError: null is not an object (evalating 'n.default.configureProps') React Native Jitsi Meet
- java - 如何在 Mockito 中模拟 CallableStatement
- python - 如何运行并行线程以在视频流的每一帧上应用函数?
- c - 在 for 循环之后的 Scanf 函数不起作用
- algorithm - 如何从代码中获取流程图或算法?
- c# - 当左 div 元素变长时,如何确保我的左 div 元素不会改变我的右 div 元素的位置?
- c++ - 显示所有匹配值的二进制搜索功能?