Why am I getting 'undefined' on data variable in checkout UI extension event?

AbhinavTiwari
Shopify Partner
7 0 0

 Why i am getting undefined on data variable on checkout ui extension event when i run fetch product query then i am getting proper response 

const { query, applyCartLinesChange, i18n } = useApi()
 
 //fetch customer tag
    async function fetchCustomerTag(customer_Id) {
        console.log(customer_Id)
        try {
            const { data } = await query(
                `query {
                    customer(id: "gid://shopify/Customer/7350518120722") {
                        tags
                  }
                }`,
                {
                  variables: { first: 5 },
                }
              );
              console.log(data);
        } catch (error) {
            console.error(error);
        }
    }

 

Replies 0 (0)