Getting Line item vendor within Shopify Checkout UI extension

pranavp1507
Shopify Partner
1 0 0

I'm trying to build a solution to prevent customers from checking out with an item if the item within checkout is a specific vendor and the discount code used is a specific code. I'm new to Shopify dev scene and am trying to learn myself. I am not sure if I should build a Shopify function or a Shopify Checkout UI extension. I tried to achieve this using Checkout UI extension and using GraphQL query to get the vendor data using useApi. My GraphQL query is:

query GetCheckoutData($checkoutId: ID!) {
              node(id: $checkoutId) {
                ... on Checkout {
                  id
                  lineItems {
                    nodes {
                      id
                      variant {
                        id
                        product {
                          id
                          vendor
                        }
                      }
                    }
                  }
                }
              }
            }

but I don't get any return. I tried console logging this data and this is what I saw:

Object { message: "Internal error. Looks like something went wrong on our end.\nRequest ID: f30dcd81-3eb3-4b04-82e6-095f8df2577a-1709906907 (include this in support requests).", extensions: {…} }

I'm not sure what I'm doing wrong. Also, where I should request support. Thank you in advance for any help.

Replies 0 (0)