hydrogen icon indicating copy to clipboard operation
hydrogen copied to clipboard

🐛 Data: Inconsistent GraphQL Response

Open jonasivy opened this issue 2 years ago • 5 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-04

What version of Remix are you using?

"@remix-run/react": "1.17.1"

Steps to Reproduce

Contents of our website is based on Metaobject of shopify. Noticed that the return contents differ every time I refresh.

Query:

fragment MediaImageFragment on MediaImage {
  id
  __typename
  mediaContentType
  image {
    id
    width
    height
    url
    altText
  }
}

fragment BadgesFragment on Metaobject {
  internalName: field(key: "internal_name") {
    value
  }
  text: field(key: "text") {
    value
  }
  colorTheme: field(key: "color_theme") {
    reference {
      ... on Metaobject {
        ...ColorThemeFragment
      }
    }
  }
  backgroundColor: field(key: "background_color") {
    value
  }
  fontColor: field(key: "font_color") {
    value
  }
  image: field(key: "image") {
    reference {
      ... on MediaImage {
        ...MediaImageFragment
      }
    }
  }
  visibility: field(key: "visibility") {
    value
  }
}

fragment ColorThemeFragment on Metaobject {
  internalName: field(key: "internal_name") {
    value
  }
  backgroundColor: field(key: "background_color") {
    value
  }
  fontColor: field(key: "font_color") {
    value
  }
}

query PDPProductContent($handle: String!) {
  product(handle: $handle) {
    handle
    badges: metafield(namespace: "custom", key: "badges") {
      references(first: 10) {
        nodes {
          ... on Metaobject {
            ...BadgesFragment
          }
        }
      }
    }
  }
}

Variable:

{
  "handle": "oru-paddle"
}

Inconsistency comes from the previous value of the Metaobject and the current value.

https://www.loom.com/share/db08412468ea4e5fa6be9c935afbce2b?sid=f4a4aaae-595e-452d-87dc-0fc43e5c32d6

Expected Behavior

Consistent response based on store metaobject data.

Actual Behavior

Unstable Response

jonasivy avatar Aug 03 '23 12:08 jonasivy

Hi team, any update on this issue?

jonasivy avatar Aug 07 '23 08:08 jonasivy

Hi @jonasivy, we are digging into this on our end and will give you an update soon.

blittle avatar Aug 07 '23 14:08 blittle

Thanks for reporting @jonasivy. This issue has been reported internally, but it may be worth opening directly in the Storefront API feedback repo

juanpprieto avatar Aug 07 '23 15:08 juanpprieto

Thanks for the update @blittle, let me know if you need any additional info to help you with the investigation.

jonasivy avatar Aug 07 '23 15:08 jonasivy

@juanpprieto, am about to file a ticket but found this ticket here. Looks like we have the same issue.

jonasivy avatar Aug 07 '23 15:08 jonasivy

Closing the issue here, as it's reported with the SFAPI and that's where the problem is.

blittle avatar Jun 21 '24 20:06 blittle