Not able to enter product within Merchandise

Incentro
Shopify Partner
2 0 0

Dear Shopify Community,

 

I'm currently busy with setting up the queries for the cart of a customer. 

 

I want to get the products from the cart. My query has these fields: cart->lines->edges->node->merchandise-> product.

The query works and I get my data. But when I try to get to the merchandise part, there are no options to select .onProductVariant (just like at android). I can only call .self, because of this I can't get the products shown in the view. (see image)image.png

 

Let me know if you need more information.

 

Kind regards

Replies 2 (2)

c10s
Shopify Partner
67 12 25

You need to make sure in your actual Storefront GraphQL query you're including the fields, should look something like this:

 

query cart($id: ID!) {
  cart(id: $id) {
    lines(first: 50) {
      edges {
        node {
          id
          quantity
          merchandise {
            ... on ProductVariant {
              title
              product {
                title
              }
            }
          }
        }
      }
    }
  }
}

 

Incentro
Shopify Partner
2 0 0

Hi C10s,

 

My query looks like this:

Incentro_0-1650352511901.png

But unfortunately, it is still not possible to reach the .onproductVariant.