Product variants error

Product variants error

dripdevelopment
Shopify Partner
6 0 0

Why am I getting always only the last variant of a product, even if I specify to get more than 1 (e.g. first: 3)?

I've tried a couple of things, the first was directly fetching variants by searching variants with the same product_id, and I've also tried fetching all the variants in a product query (e.g. query{products(first: 10){edges{ node{ variants(first:10){edges{node{}}}}}}} )

Reply 1 (1)

LucaRaveri
Shopify Partner
15 0 2

Hey @dripdevelopment,

I think you should provide more details about your issue.

I tried this query and everything works fine:

query {
  products(first: 10) {
    edges {
      node {
        title
        variants(first: 10) {
          edges {
            node {
              id
              title
            }
          }
        }
      }
    }
  }
}

 

If this was helpful, please Like it ⬆️
If this solved your problem, please Mark it as solution