Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL StoreFront api - Page reference not working #1396

Open
aleandro-coppola opened this issue Oct 4, 2023 · 1 comment
Open

GraphQL StoreFront api - Page reference not working #1396

aleandro-coppola opened this issue Oct 4, 2023 · 1 comment
Labels
Storefront API Issues related to https://shopify.dev/docs/api/storefront

Comments

@aleandro-coppola
Copy link

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 aleandro-coppola changed the title GraphQL Page reference not working GraphQL StoreFront api - Page reference not working Oct 4, 2023
@denbechka
Copy link

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

@michenly michenly added the Storefront API Issues related to https://shopify.dev/docs/api/storefront label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Storefront API Issues related to https://shopify.dev/docs/api/storefront
Projects
None yet
Development

No branches or pull requests

3 participants