Closed ravewebdev closed 2 years ago
Issue is still occurring as of WP GraphQL v1.3.2.
Hi @ravewebdev thanks for your great work on this. I am having an issue and was wondering if it is the behavior you describe here. While browsing my site in some moments, requests to pages that worked begin to fail as in the following screenshot
After some time I can refresh the page and the requests work again. I am hosted on WP Engine and there are no errors there. I'm not sure if this issue may be related or #153 but the strange thing is that it happens intermittently. Maybe with your experience you have noticed something similar. Thanks!
@rodrigo-arias I can't say for sure but it's possible your issue is related to one of these two GraphQL plugin bugs. Is the issue occurring with specific pages or post types, or does it appear random? Have you tried changing the permalink structure (e.g., to "Post name") to see if the issue still occurs? It could also be a timeout issue between your frontend and your WP Engine site; do you have a local copy for testing, and if so, does the issue occur there?
@ravewebdev thank you for your input. After researching those options it seems that WP Engine is not able to handle all requests even when it's just me doing QA. The Apollo query cache works fine, I also have the WP Engine object cache enabled, but I still get 504 errors when the PHP workers and the backlog queue are full. I share some articles that were useful to me, in case they are useful to someone else
Just curious, are you using a different architecture solution vs. a monolithic WordPress? I'm somewhat surprised that having less than 200 pages the server cannot handle the uncached requests.
Original issue is still occurring as of WP GraphQL v1.6.5.
Our custom permalink structure seems to be causing weird errors when querying by slug/URI: https://github.com/wp-graphql/wp-graphql/issues/1639. When attempting to query a non-existent post, GraphQL is throwing an error instead of returning null.
Once this is fixed,
getPostTypeStaticProps
should be refactored, specifically regardingpageData.error
:notFound
prop if an actual error is encountered. In that case, we should remove the earlynotFound
returns, which will passerror
anderrorMessage
along to_app.js
, which will render theError
component.getPostTypeStaticProps
should receive (from whichever getter function) no error but a null value for thepost
prop (I believe this is already the case but should be confirmed). Then we can usenotFound
, e.g.:This will then render the 404 page, but actual errors will show the Next.js error component instead.