graphql fails at adiing 100+ products to my Wordpress Woocomerce store

Viewed 50

Anyone knows how to fix this graphql error? I couldn't add more than 50 items to my store.
I have raised the timeout in options schema options: {schema: { timeout: 1000000,},}
and added this line to wp.config file define( ‘WP_MEMORY_LIMIT’, ‘512M’ );
but it didn't solve the problem. My maximum's 46 items, but I guess that's not the limit.

info  gatsby-source-wordpress  GraphQL vars: {"first":70,"url":"http://my-web-url/graphql","after":null}
error  gatsby-source-wordpress  Your wordpress server at http://my-web-url/graphql appears to be overloaded.
Try reducing the requestConcurrency for content updates or the previewRequestConcurrency for previews:
{
  resolve: 'gatsby-source-wordpress-experimental',
  options: {
    schema: {
      requestConcurrency: 5, // currently set to undefined
      previewRequestConcurrency: 2, // currently set to undefined
    }
  },
}
The GATSBY_CONCURRENT_REQUEST environment variable is no longer used to control concurrency.
If you were previously using that, you'll need to use the settings above instead.
not finished source and transform nodes - 5.466s
not finished  gatsby-source-wordpress  fetching nodes - 5.390s - 15 total
not finished  gatsby-source-wordpress  PaColor - 3.871s
not finished Downloading remote files - 3.569s
not finished Generating image thumbnails - 3.428s
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
Command: /node14/bin/node
Arguments: /vercel/.yarn/lib/cli.js build
Directory: /vercel/path0/site
Output:
info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gatsby-woocommerce-themes@2.0.1 build: `yarn workspace site build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the gatsby-woocommerce-themes@2.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /vercel/.npm/_logs/2021-09-21T17_39_01_248Z-debug.log
Error: Command "npm run build" exited with 1
1 Answers

Well, it's quite straightforward. You've reached a timeout/overloading response, not only because of the number of pages but its content and heaviness. Use the provided solution:

{
  resolve: 'gatsby-source-wordpress',
  options: {
    schema: {
      requestConcurrency: 50, 
      previewRequestConcurrency: 50, 
    }
  },
}

And play with requestConcurrency and previewRequestConcurrency values as the docs suggests. Using the previous values (50) should work because now are set as undefined so you should see some improvements.

Notice the following statement which is also important if you are using GATSBY_CONCURRENT_REQUEST environment variable:

The GATSBY_CONCURRENT_REQUEST environment variable is no longer used to control concurrency. If you were previously using that, you'll need to use the settings above instead.

Related