New Shopify Certification now available: Liquid Storefronts for Theme Developers

Cart attribute value from the "input.graphql" returns NULL in a "cart checkout validation" function.

Solved
slasw7
Shopify Partner
12 0 0

Hi, I'm having problem retrieving cart attribute value from the "input.graphql" in a "cart checkout validation" function.

 

My site is using the new checkout system and I developed a custom extension-only app for customizing it.

 

There are several extensions in the app. One of the extension is a "cart checkout validation" function.I find that it the cart attributes in the input.graphql are all returning null value. It was working fine (has value) until yesterday.

 and I'm not sure why:

 

Some observations:

1. I am very sure I did not touch the code and the same piece of code was returning values before.
2. After checkout, I checked that the order indeed has all of the cart attributes in the order details in admin panel.

3. Other extension types (e.g. "delivery_customization", "ui_extension") in the same app are using the same cart attributes just fine.
4. I created another "cart checkout validation", it cannot get the cart attributes also.

5. I tried disabling/enabling the checkout rule and even reinstalled the whole app, but it does not help.

 

It seems to me that only the cart attributes in the "cart checkout validation" input are not returning value.

 

The extension is on api_version = "2023-07".

My input.graphql:

 

query Input {
  localization {
    language {
      isoCode
    }
  }
  buyerJourney {
    step
  }
  cart {
    attrAddressType: attribute(key: "address_type") {
      value
    }
    attrAddressPrefill: attribute(key: "address_prefill") {
      value
    }
    deliveryGroups {
      deliveryAddress {
        address1
        city
        provinceCode
        countryCode
        zip
      }
    }
  }
}

In the function:

 

 

 

const addressType = input.cart.attrAddressType?.value; // Returns NULL
const addressPrefill = input.cart.addressPrefill?.value; // Returns NULL

 

 

 

 

Accepted Solution (1)
Liam
Shopify Staff
Shopify Staff
1917 204 580

This is an accepted solution.

Hi folks! 

 

Our team shipped a fix for this recently so you shouldn't be seeing this error moving forward. Please let us know if any of your stores are experiencing this.

 

Hope this helps,

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 11 (11)
st-kietvo
Shopify Partner
4 0 1

We have same issue, that work fine until yesterday. Today, I got null 😳

vy2902
Shopify Partner
26 0 0

i had the same problem.

But it seems like Shopify don't support this problem.

nhtbao101
New Member
12 0 0

I have the same problem with it. Maybe it just happened recently

Liam
Shopify Staff
Shopify Staff
1917 204 580

Hi folks,

 

Will investigate this issue today to see if there's been a change on our side that has caused this. I'll report back asap!

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

slasw7
Shopify Partner
12 0 0

Hi @Liam 

Any updates?

Can you confirm the issue lies on Shopify's end or not?

Sorry for urging, but this function is crucial in my site's checkout logic. 

Liam
Shopify Staff
Shopify Staff
1917 204 580

Hi Slasw7 - it does appear the issue is on Shopify's side. Our developers are looking into a fix at the moment. 

 

Appreciate your patience here!

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

nhtbao101
New Member
12 0 0

This problem just happened 7-8 days ago. But in this morning, I rechecked and it came back, and now it's working. I don't know why, maybe Shopify just updated something?

slasw7
Shopify Partner
12 0 0

Thanks for your information @nhtbao101 , I turned the function on just now and it came back too.

Liam
Shopify Staff
Shopify Staff
1917 204 580

This is an accepted solution.

Hi folks! 

 

Our team shipped a fix for this recently so you shouldn't be seeing this error moving forward. Please let us know if any of your stores are experiencing this.

 

Hope this helps,

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

slasw7
Shopify Partner
12 0 0

Thanks Liam, it's working like a charm.

neonninja
Shopify Partner
1 0 0

We are still facing this issue for the last couple of days. Any one else facing the problem now