Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Storefront API Version: 2021-10.
What I'm trying to do: Query `MediaImage` data associated with a product metafield.
After :
I use the following query to request the image data contained in the metafield:
query {
product(handle: "high-roller-skates") {
handle
metafields(first: 5) {
edges {
node {
namespace
key
value
}
}
}
}
}
which returns:
{
"data": {
"product": {
"handle": "high-roller-skates",
"metafields": {
"edges": [
{
"node": {
"namespace": "my_fields",
"key": "bearings",
"value": "gid:\/\/shopify\/MediaImage\/20867885990023"
}
}
]
}
}
}
}
Using the Shopify Global ID given in the metafield's `value`, I run a second query for the actual image data:
{
node(id: "gid://shopify/MediaImage/20867885990023") {
... on MediaImage {
id
image {
altText
originalSrc
}
mediaContentType
}
}
}
Unfortunately, this results in an `INTERNAL_SERVER_ERROR`:
{
"errors": [
{
"message": "Internal error. Looks like something went wrong on our end.\nRequest ID: fc94c2e8-9b59-4d8e-9eb3-2eb2a6e49f78 (include this in support requests).",
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"requestId": "fc94c2e8-9b59-4d8e-9eb3-2eb2a6e49f78"
}
}
]
}
I've tried using the base-64 encoded version of the global ID ("Z2lkOi8vc2hvcGlmeS9NZWRpYUltYWdlLzIwODY3ODg1OTkwMDIz"), but this results in the same `INTERNAL_SERVER_ERROR`.
Is this a bug in the Storefront API, or is there another issue at play?
Solved! Go to the solution
This is an accepted solution.
The Storefront API bug has been fixed. I'm now able to query for `MediaImage` nodes:
Thanks for fixing this bug!
This is a bug on Shopify's side as you suspected. I've created an issue internally and it should hopefully be fixed soon.
Thank you for the very detailed post.
To learn more visit the Shopify Help Center or the Community Blog.
Thank you so much for the response and for creating the bug ticket, @swalkinshaw!
This is an accepted solution.
The Storefront API bug has been fixed. I'm now able to query for `MediaImage` nodes:
Thanks for fixing this bug!