cURL error 28 when running Graph QL query

Hi. We have a recurring issue when trying to run a very specific graphql query and I cannot work out what is so controversial about it.

The specific error we are getting is:

PHP Fatal error:  Uncaught GuzzleHttp\Exception\ConnectException: cURL error 28: Resolving timed out after 10000 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://....myshopify.com/admin/api/2022-07/graphql.json in /............/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:210

Guzzle aside, it seems like it’s the actual query call to Shopify that’s throwing the error. i.e when we run:

$get_products_result = $api->graph($get_products_query);

This is the query:

{
    product(id: "gid://shopify/Product/' . $shopify_product_id . '") 
    {
        id,
        title,
        onlineStoreUrl,
        status,
        handle,
        vendor,
        tags,
        featuredImage {
            url
        },
        metafields(first: 5 namespace: "filters") {
            edges {
                node {
                    namespace,
                    key,
                    value
                }
            }
        },
        collections(first: 50) {
            edges {
                node{
                    id
                }
            }
        },
        variants(first: 100) {
            edges {
                node {
                    id,
                    title,
                    image {
                        url
                    },
                    price,
                    compareAtPrice,
                    availableForSale,
                    sku,
                    sheen: metafield(key:"sheen" namespace:"filters"){
                        value
                    },
                    swatch_name: metafield(key:"swatch_name" namespace:"filters"){
                        value
                    },
                    hazardous: metafield(key:"hazardous" namespace:"shipping"){
                        value
                    },
                    oversize: metafield(key:"oversize" namespace:"shipping"){
                        value
                    }
                }
            }
        }
    }
}

The query does work because it’s running on a cron job and it does go through eventually. I was running the cron every minute, so I slowed it to every 45 minutes and now it’s running every 5 minutes. It times out very irregularly. Definitely not every time, but sometimes once or twice an hour and usually every 1 - 2 hours.

Can anyone see anything obviously wrong with this query? I know it’s big but it’s a shopify plus store so I really think Shopify should be able to handle it?

I just experienced a similar error, but in my case, it was random. I tried again, and it didn’t happen next time. Now, I’m not sure how I can live with it.

So if it helps, for us, one day, they just completely stopped. We tried absolutely everything to fix them and nothing worked so in the mean time, we coded around it - I built a system that basically ignored the error just as long as it worked some of the time, and it only notified me if it hadn’t worked after a certain threshold, which it usually did.

Could never get an answer for this, sorry I can’t be more help.