hydrogen
hydrogen copied to clipboard
GraphQL StoreFront api - Page reference not working
What is the location of your example repository?
No response
Which package or tool is having this issue?
Storefront API
What version of that package or tool are you using?
2023-10
What version of Remix are you using?
No response
Steps to Reproduce
- I created a simple metafield shop.subPages -> Type: Page - List of pages (NO single page)
- I created 2 simple page
- In one of this page I add a metafield subPages, and select the second page
QUERY:
{
page(handle: "page-1") {
title
handle
metafields(identifiers: [
{key: "subPages", namespace:"shop"},
{key: "medias", namespace:"shop"}
]) {
id
key
references(first:10) {
__typename
nodes {
... on MediaImage {
id
}
... on Page {
id
}
__typename
}
}
}
}
}
RESULT:
{
"data": {
"page": {
"title": "Page 1",
"handle": "page-1",
"metafields": [
{
"id": "gid://shopify/Metafield/3592458538***********",
"key": "subPages",
"references": {
"__typename": "MetafieldReferenceConnection",
"nodes": []
}
},
{
"id": "gid://shopify/Metafield/3592440519*******",
"key": "medias",
"references": {
"__typename": "MetafieldReferenceConnection",
"nodes": [
{
"id": "gid://shopify/MediaImage/4509478404*******",
"__typename": "MediaImage"
}
]
}
}
]
}
}
}
Expected Behavior
The reference on the page metafield node
Actual Behavior
The node object of pages reference is empty Instead the node object of medias is correct (I created also a metafield with medias list)
I'm having the same problem. Any updates here?
If this is still a problem, please create an issue here: https://github.com/Shopify/storefront-api-feedback