Internal Error with GraphQL Storefront API Query (2025-01) When Including price/compareAtPrice

Hi Shopify Developer Community,

I’m encountering an “Internal error” when querying the Shopify Storefront API (version 2025-01) for product data, specifically when including the price and compareAtPrice fields. The error disappears when I remove these fields, but I need them for my application. Any help or insights would be greatly appreciated!

Error Details

  • Error Message: "Internal error. Looks like something went wrong on our end. Request ID: 985b7d35-2008-4159-8995-af096a8b3e6f-1752781119
  • API Version: 2025-01

Following is the query:

query($productIds: String!, $countryVar: CountryCode!, $languageCode: LanguageCode!) @inContext(country: $countryVar, language: $languageCode) {
  products(first: 2, query: $productIds) {
    nodes {
      id
      title
      handle
      images(first: 1) {
        nodes {
          url
        }
      }
      options {
        name
        values
      }
      variants(first: 250) {
        nodes {
          id
          title
          availableForSale
          price {
            amount
            currencyCode
          }
          compareAtPrice {
            amount
            currencyCode
          }
          selectedOptions {
            name
            value
          }
          image {
            id
            url
          }
        }
      }
    }
  }
}

Do you share your request parameters?

Modify the price and compareAtPrice formats.

query {
  products(first: 2) {
    nodes {
      id
      title
      handle
      images(first: 1) {
        nodes {
          url
        }
      }
      options {
        name
        values
      }
      variants(first: 250) {
        nodes {
          id
          title
          availableForSale
          price
          compareAtPrice 
          selectedOptions {
            name
            value
          }
          image {
            id
            url
          }
        }
      }
    }
  }
}

Hi @kyle_liu

Thank you for the response.
I did try the same and got this response

"errors": [
        {
            "message": "Field must have selections (field 'price' returns MoneyV2 but has no selections. Did you mean 'price { ... }'?)",
            "locations": [
                {
                    "line": 41,
                    "column": 11
                }
            ],

Just to clarify, the previous query is working fine across all other stores. The error seems to be occurring only on a specific store.

Are there any related characteristics of this specific store where this error is being produced?

This is a merchant store, and I’m not exactly sure what’s causing the issue. Could you please check the logs using the request ID to help identify the root cause?

Hey @Monika_Sharma :waving_hand: - just following up here for Liam. I was able to pull some logs using the request ID you shared (thanks for that!) and it does look like there was an internal error on our end.

I tried replicating your query from that request on the shop using our internal tools and I wasn’t able to replicate the error, could you let me know if the issue is still persisting? Happy to dig into this further for sure, but I just wanted to see if it’s still happening on the shop so we can prioritize things if needed.

Hope to speak with you soon - we’ll get this looked into!

1 Like

Hi @Alan_G
Thank you for checking the logs!

When we checked the market settings, we found that the issue occurs if we select specific catalogs for a given market. In that case, the query throws an error. However, if no catalog is selected (i.e., the default “All products” is used), the query works fine.

Hope this helps in identifying the root cause.

Hi @Monika_Sharma - no worries! This does definitely seem odd, thanks for sharing that additional context there. I’m going to do some further investigation into this with our product team and I’ll loop back with you once I have next steps/can share a fix.

Speak with you as soon as I have more info :slight_smile:

Hi again @Monika_Sharma - just following up here. I was able to touch base with the product team on this, and we were unable to replicate the issue again. Would you be able to share the full query you’re using (including the input variables if possible). We were able to pull a query from the logs, which is what we used to try and replicate things, but just wondering if you’d be able to share the call you’re using that results in the error as well to see if there are any differences in terms of your input vs. what we’re receiving on our end. Here’s the API call we pulled from the logs from your request ID:

query($productIds: String!, $countryVar: CountryCode!, $languageCode: LanguageCode!) @inContext(country: $countryVar, language: $languageCode) { products(first: 2, query: $productIds) { nodes { id title handle images(first: 1) { nodes { src } } options { name values } variants(first: 250) { nodes { id title availableForSale price { amount currencyCode } compareAtPrice { amount currencyCode } selectedOptions { name value } image { id url } } } } } }

variables:

{"countryVar":"BE","languageCode":"EN","productIds":"8756147945818 OR 10238214734170"}

Hope to hear from you soon, definitely happy to continue investigating this as it is quite odd.

Hi @Alan_G ,

Thank you for the follow-up and for looking into this.

I wanted to clarify that the reason you’re able to retrieve the data is because, in the store settings, the market catalog is currently set to “all-products”. This is why the query works fine.

However, on our side, we are facing the issue when the market is configured to target specific catalogs. Since this is a live store, I’m unable to switch the market setting back to “all-products” just for testing, as it would impact the live setup.

For your reference, I’ve also recorded a video demonstrating the issue — showing the difference in API responses when switching between specific catalog and all-products settings. I hope this visual example will help in identifying the root cause and finding a resolution.

https://www.awesomescreenshot.com/video/42499126?key=1c245cecc38ae3a5f681713f03949cb8

Thanks again for your support.

Hey Monika, thanks for the sharing the video and the details there, this is very helpful. I’ll continue to work on this with our team and get back to you with more info as soon as possible on my end here.

Hi again @Monika_Sharma, just following up here. Our product team and I were able to work on this together and we’ve identified this as a possible bug. I can’t guarantee a resolution time or what a fix will look like, but I’m going to continue to keep an eye on this internally and let you know as soon as I have confirmation of a fix or more info to share, really appreciate your patience on this :slight_smile: