hydrogen icon indicating copy to clipboard operation
hydrogen copied to clipboard

GraphQL StoreFront api - Page reference not working

Open aleandro-coppola opened this issue 2 years ago • 1 comments

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

  1. I created a simple metafield shop.subPages -> Type: Page - List of pages (NO single page)
  2. I created 2 simple page
  3. 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)

aleandro-coppola avatar Oct 04 '23 11:10 aleandro-coppola

I'm having the same problem. Any updates here?

denbechka avatar Dec 12 '23 11:12 denbechka

If this is still a problem, please create an issue here: https://github.com/Shopify/storefront-api-feedback

blittle avatar Jul 18 '24 20:07 blittle