Strange behavior(bug) with barcode filter on productVariants

Hi all,

Got a strange behavior going on with ProductVariants barcode filter.

{
  productVariants(first: 1, query: "barcode:7613183629253") {
    nodes {
      id
    }
  }
}

returns nothing

"data": {
    "productVariants": {
      "nodes": []
    }
  },

doing the same thing for products

{
  products(first: 1, query: "barcode:7613183629253") {
    nodes {
      id
      variants(first:5){
        nodes{
          id
          barcode
        }
      }
    }
  }
}

returns the variant with the barcode I was looking for in the first query

{
  "data": {
    "products": {
      "nodes": [
        {
          "id": "gid://shopify/Product/14916263739771",
          "variants": {
            "nodes": [
              {
                "id": "gid://shopify/ProductVariant/55046994526587",
                ->"barcode": "7613183629253"<-
              },
              {
                "id": "gid://shopify/ProductVariant/55046994559355",
                "barcode": "7613183629239"
              },
              {
                "id": "gid://shopify/ProductVariant/55046994592123",
                "barcode": "7613183629260"
              },
              {
                "id": "gid://shopify/ProductVariant/55046994624891",
                "barcode": "7613183629277"
              },
              {
                "id": "gid://shopify/ProductVariant/55046994657659",
                "barcode": "7613183629246"
              }
            ]
          }
        }
      ]
    }
  }

The point of this though is to get the variant id immediately. Interestingly enough this code works on another shop just fine, also using SKU instead of barcode also works…

Cheers,
Gary

Hey Gary - so just to confirm, you’re only seeing this unexpected behaviour on ONE store?

Hi Liam,

I have a piece of code that we build for a Plus customer, we test code on their “dev shop” (also plus) and move it to live once tested. The code was working previously and then suddenly it stopped working on the dev shop. API version is the same for both shops, scopes are the same for both shops.

I tested the code on one other shopify development shop and it worked there so I thought it was a weird bug I thought I better ask about.

long story short… yes only on one shop so far. I could provide the request token if that would help

Cheers
Gary