首页 > 解决方案 > WordPress woocomerce graphql 失败

问题描述

在将大量产品导入我的 WordPress Woocomerce 商店后,GraphQL 开始失败。有谁知道我该如何解决这个问题?

ERROR #gatsby-source-wordpress_111007 

gatsby-source-wordpress  Request failed with status code 500

Your WordPress server is either overloaded or encountered a PHP error.

Enable WordPress debugging by adding the following to your wp-config.php file:

define("WP_DEBUG", true);
define("WP_DEBUG_LOG", true);
define("GRAPHQL_DEBUG", true);

(See https://wordpress.org/support/article/debugging-in-wordpress/ for more info)

Then run another build before checking your WordPress instance's debug.log file for errors.

If you don't see any errors in debug.log:

Try reducing the requestConcurrency for content updates or the previewRequestConcurrency for previews, and/or
reducing the schema.perPage option:

{
  resolve: 'gatsby-source-wordpress',
  options: {
    schema: {
      perPage: 20, // currently set to 100
      requestConcurrency: 5, // currently set to 50
      previewRequestConcurrency: 2, // currently set to 5
    }
  },
}

标签: graphqlgatsby

解决方案


为 wordpress 分配更多内存解决了这个问题。

将此行添加到 wp.config 文件。

define( ‘WP_MEMORY_LIMIT’, ‘512M’ );

推荐阅读