[Storefront] Internal Server Error on retrieving Product with variants field

Hi.

We’ve recently been encountering intermittent issues with the GraphQL Storefront API where if we retrieve the products with its variants included, we get the error: “Internal error. Looks like something went wrong on our end.”

Here is the GraphQL query:

{
    products(first: 10) {
        edges {
            node {
                id
                title
                descriptionHtml
                variants(first: 6) {
                    edges {
                        node {
                            id
                            title
                            price {
                                amount
                            }
                            compareAtPrice {
                                amount
                            }
                        }
                    }
                }
            }
        }
    }
}

When removing the variants field in the query, it always returns the data with no errors. Sometimes the error rarely occurs, but there are instances when all requests would result to the same error. I assumed this could be due to the rate limits(?), but if I’m reading this correctly, Storefront API calls don’t have rate limits or add anything into it. (Source)

Insights or solutions would be valuable to us, so if there are any, please advise. Thank you!

Request Ids (will update this list as much as I can as we encounter it again):

  • 56af1c0e-deeb-49ba-809e-49499561d29b-1744715382
  • a6362ef6-7f79-4df2-9f22-9cbf095331f6-1744733103
  • 286f878d-f3e2-4487-afde-b55a676c50bc-1744761298
  • be18731b-40ce-49de-a05b-e2b79fc236b3-1744762269
1 Like

Hey @Daniel_Torralba - thanks for sharing those request IDs - I wasn’t able to replicate the issue internally on my end here, but we’ll look into this a bit further to see if we can see why this is popping up intermittently for you.

I’ll loop back with you when I have some more info to share :slight_smile:

Hi, Alan. Thanks for responding.

If it helps progress the investigation, I’ve also noticed the error not appearing whenever I reduce the ‘first’ parameter in the variants field to ‘1’. I then try incrementing it up by one until it reaches ‘6’ and those queries are also not showing the error anymore for some reason.

The error seems to begin occurring if I haven’t fired up a POST request in a few minutes in my system, and it recurs until I change up the variant parameter to ‘1’. I tried decrementing it until it reaches ‘1’ and the error only stopped showing once I get to ‘1’.

May I ask if there’s a way to know how heavy this GraphQL query is on our end? It could be that retrieving the products in our store might be a bit heavy in the API.

Thanks @Daniel_Torralba - that does definitely help. I have seen similar issues in the past where a specific variant/product record can cause an internal error on our end, so I wonder if this is what’s happening here.

Just looping back with you here as well to confirm we’re still looking into this, no concrete timeline still, but there has been some movement in our investigation too. I’ll be in touch again as soon as I have more info!