Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Storefront API Version: 2023-07.
What I'm trying to do: Query `storeAvailability` data associated with a product variant.
the query:
query getStoreAvailability($handle: String!) { product(handle: $handle) { availableForSale variantBySelectedOptions(selectedOptions: {name: "Color", value: "Ice"}) { sku title weight quantityAvailable storeAvailability(first: 1) { edges { node { available pickUpTime location { name } } } } } } }
which returned:
Unexpected Server Error Error: Internal error. Looks like something went wrong on our end. Request ID: e49c46aa-80d3-4815-9e45-68e8acf8da1b (include this in support requests).
Is this a bug in the Storefront API, or is there another issue at play?
Hi Huykon225,
The error message you're seeing usually indicates an issue on the server side. However, it could also be due to an error in your query. The Storefront API is quite particular about the structure and syntax of the queries it receives.
Here's a few things to check:
Make sure that the $handle
variable you're passing into the query is a string and that it corresponds to an existing product in the store.
Ensure that the selectedOptions
you're querying actually exist for the product variant. In your query, you're querying for the variant where the option name is "Color" and the value is "Ice". If no such variant exists, this could potentially cause an issue.
The storeAvailability
field is only available on the Variant
object, and it's possible that not every variant will have this field. If you're querying a variant that doesn't have storeAvailability
data, this might cause an error.
Make sure that the API version you're using (2023-07) is correct and supports the fields you are querying.
Let us know here after checking these points you're still experiencing the issue, since it could be a bug or temporary issue with the Storefront API. Hope this helps,
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hi @Liam ,
Thank for your responding. I can make sure all of my input & product data have enough as your mention above. I'm also using the latest version of API is 2023-07 . Please check the API help me.
Thanks