[Storefront] Internal Server Error on retrieving multiple varinats

We’ve recently been encountering INTERNAL SERVER issues with the GraphQL Storefront API where if we retrieve the products with more than 8 variants, we get the error: “Internal error. Looks like something went wrong on our end.
|id :6ec383b4-6106-43fb-9b7c-21b89e298769-1748510002"

Here is the GraphQL query
const productFragment = /* GraphQL */ `
fragment product on Product {
id
handle
availableForSale
title
description
descriptionHtml
metafield(namespace: “feature”, key: “list”) {
value
type
}
options {
id
name
values
}
priceRange {
maxVariantPrice {
amount
currencyCode
}
minVariantPrice {
amount
currencyCode
}
}

variants(first:250) {
  edges {
    node {
      id
      # title
      availableForSale
      selectedOptions {
        name
        value
      }
      price {
        amount
        currencyCode
      }
    }
  }
  pageInfo {
  hasNextPage
  endCursor
}
}
featuredImage {
  ...image
}
images(first: 5) {
  edges {
    node {
      ...image
    }
  }
}

Hey @Beitroot_LLC , I see you have also posted here:

If you remove the variants or request a lower amount, does it work then?

@KyleG-Shopify Yes, If i bring the total number of variants to less than 8-10, it works

Thanks. I’m having trouble replicating this on my end. Can you share the specific query you were using and any query filters that may have been applied?

For example is this a product query where this happens on a specific product, or is this a products query returning multiple products?

Also, are you using an app generated storefront access token, or are you using a token generated through one of the headless channels?

Just to add one more thing, I did notice your query is requesting options.values, which is deprecated. I’m not sure it will change anything, but can you replace that with options.optionValues to ensure the full query is using current values.

@KyleG-Shopify I’m using product query to fetch a single product with all available variants and im facing the issue only when i create more number of variants (anything above 8-10+ variants)
Yes, im using a token generated through one of the headless channels

I tried changing options.values to options.optionsValues, still the same

@KyleG-Shopify I also noticied if i add variants one by one from variant details page, the system throws error initially and after sometime it works.