Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: [GraphQL] productVariants search not working with "barcode" query

[GraphQL] productVariants search not working with "barcode" query

MrBasicX
Shopify Partner
5 0 4

Hey there,

 

I hope you all are doing well. I have encountered an issue today (this started around 9 AM IST of 03rd March 2023), where when using productVariants GraphQL query, if we use "barcode" in query, no matching variants are being returned. But doing the same with "sku" is working as expected. I have contacted support already, but they have said that the relevant team will investigate it further. We have a lot of app  (scripts for use) affected by this issue.

 

 

{
  productVariants(
    first: 250
    query: "barcode:12345"
  ) {
    edges {
      node {
        sku
        barcode
      }
    }
  }
}

The above query, using "barcode" results in no results.

{
  "data": {
    "productVariants": {
      "edges": []
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 252,
      "actualQueryCost": 2,
      "throttleStatus": {
        "maximumAvailable": 10000.0,
        "currentlyAvailable": 9998,
        "restoreRate": 500.0
      }
    }
  }
}

 

 

But doing the query with "sku" gives the proper variant as expected.

{
  productVariants(
    first: 250
    query: "sku:SKU1"
  ) {
    edges {
      node {
        sku
        barcode
      }
    }
  }
}
{
  "data": {
    "productVariants": {
      "edges": [
        {
          "node": {
            "sku": "SKU1",
            "barcode": "12345"
          }
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 252,
      "actualQueryCost": 3,
      "throttleStatus": {
        "maximumAvailable": 1000.0,
        "currentlyAvailable": 997,
        "restoreRate": 50.0
      }
    }
  }
}

 

As in shown shown screenshot, the barcode given in query is correct.

 

MrBasicX_0-1677833645771.png

 

I have reproduced it in a dev store as well and found the same issue in 2 live stores. Can anyone confirm this on their end and if possible provide solution? Any response will be appreciated. Thank you so much.

Replies 9 (9)

garyrgilbert
Shopify Partner
432 41 190

I Can confirm this does not work.

 

Not only that its a retroactive bug and affects all API versions going back to 2022-04, including the release candidate and unstable versions.

 

This is not the first retroactive bug introduced this year, which leads me to believe that this is not an API specific bug, but involves an underlying core system otherwise it would be isolated to a specific API Version. 

 

Lets hope they light a fire under this because I believe it is related to the filtering bugs I reported at the end of Jan.

 

Cheers,

 

Gary

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
NetDave
Shopify Partner
6 0 3

I encountered this bug today too. It is occurring consistently today.

 

I also saw it on 26 of July 2022 and I logged it (below).

 

This was using the 2021-10 API. In my case this bug causes duplicate items to be imported into the stores running my app.

 

Below, my app made an identical request in the same store three times throughout the day:

 

The first request worked and returned one productVariant (id: ...043).

 

The second request returns no productVariants even though the same item was in the store (consequently, in this case, the app went ahead and re-imported the respective item into the store).

 

The third request succeeded returning the original productVariant (...043), PLUS the recently imported duplicate.

 

I hope this helps. I've lost days managing the duplicates this has caused in many stores. Any suggestions that may help mitigate would be welcome!

 

 

 

 

[26-Jul-2022 08:35:14 UTC] REQUEST: query {
      productVariants(first:2, query:"barcode:72446") {
        edges {
          node {
            id
            barcode
            sku
          }
        }
      }
    } RESPONSE:{"data":{"productVariants":{"edges":[{"node":{"id":"gid:\/\/shopify\/ProductVariant\/43557644108043","barcode":"72446","sku”:”1111”}}]}},”extensions":{"cost":{"requestedQueryCost":4,"actualQueryCost":3,"throttleStatus":{"maximumAvailable":1000.0,"currentlyAvailable":997,"restoreRate":50.0}}}}

[26-Jul-2022 16:37:29 UTC] REQUEST: query {
      productVariants(first:2, query:"barcode:72446") {
        edges {
          node {
            id
            barcode
            sku
          }
        }
      }
    } RESPONSE:{"data":{"productVariants":{"edges":[]}},"extensions":{"cost":{"requestedQueryCost":4,"actualQueryCost":2,"throttleStatus":{"maximumAvailable":1000.0,"currentlyAvailable":998,"restoreRate":50.0}}}}

[26-Jul-2022 20:43:10 UTC] REQUEST: query {
      productVariants(first:2, query:"barcode:72446") {
        edges {
          node {
            id
            barcode
            sku
          }
        }
      }
    } RESPONSE:{"data":{"productVariants":{"edges":[{"node":{"id":"gid:\/\/shopify\/ProductVariant\/43557644108043","barcode":"72446","sku”:”1111”}},{“node":{"id":"gid:\/\/shopify\/ProductVariant\/43572250149131","barcode":"72446","sku”:”1111”}}]}},”extensions":{"cost":{"requestedQueryCost":4,"actualQueryCost":4,"throttleStatus":{"maximumAvailable":1000.0,"currentlyAvailable":996,"restoreRate":50.0}}}}

 

 

 

 

 

 
 
 
develop
Shopify Partner
11 0 8

Hello to all, we are having the exact issue in a very important component of our setup, anybody from Shopify can help us ?? The people at chat support has no idea what I'm talking about.

ShopifyDevSup
Shopify Staff
1453 239 532

Hello all - thanks for getting in touch. When it comes to issue reporting we do recommend getting in touch with our Partner Support Specialists through the support menu in your Partner Dashboard as these boards aren't monitored 24/7 by technical teams/developers - our partner support specialists are generally able to get in touch with our more technical support teams who can help troubleshoot issues like these further.

 

That said, if the issue still hasn't been resolved and you're still seeing errors, I'm happy to help on this asynchronously. Would you folks be able to share an X-Request-ID value from the response headers you received from Shopify for the API calls you've found to be related to the issue?  

Happy to take a look into our logs to see if we can track down the issue on our end and see if we can resolve it or answer what the reason behind it was. Hope to hear from you soon - let me know if I can clarify anything on my end.

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

NetDave
Shopify Partner
6 0 3

Hi there, thanks for replying. Regarding bug reports, I refer you to the following issue.

HOW? - To submit/report bug to Shopify Support?  - There is currently no way for partner app developers to report bugs. I tried reporting this particular bug in the chat from the partner page and I was advised that there wasn't any developer support and to try reporting it on the Discord... 

 

There really ought to be a specific option to allow the reporting of bugs affecting the APIs.

 

 

Regarding the issue above, here are the x-request-ids relating to the three queries I described in my last post.

ef268f68-9895-4cf6-8aac-2fd5ac6d67d1,

b68d6467-5294-4722-922e-5df499381bc7,

e549da12-438f-40d4-8675-599735acfc9e,

 

 

 

gr_trading
Shopify Partner
2032 148 205

Hi @MrBasicX ,

 

This seems to be issue in latest GraphQL API release. for the timebeing you can switch to API version 2022-04.

 

It's working fine in it.

 

{
  products(first: 5, query: "barcode:abc123") {
    edges {
      node {
        variants(first: 10) {
          edges {
            node {
              barcode
            }
          }
        }
      }
    }
  }
}

 

gr_trading_0-1686032007655.png

 

Hope it will help...

For any custom development WhatsApp or connect at Email ID: support@grtrading.in for quick consultation. | Shopify Free codes
To support Buy Me a Coffee

Affordable_Tech
Tourist
4 0 3

This same bug started happening today on July 23rd, 2023.  It is happening across a few different stores I built apps for.  GraphQL productVariants querying barcode doesn't find the product even though it exits.  Problem started early afternoon today (eastern time about 2pm)  I hope they fix this issue soon!!

ShopifyDevSup
Shopify Staff
1453 239 532

Hey @Affordable_Tech . Thanks for letting us know about this. Our team was able to resolve this earlier today so your barcode query's will be working again! 

 

If you notice the issue re-occurs, please reach out to our support teams so they can take a closer look. Be sure to include your app, the affected store, a timeframe and any other specific details of you request to help us look in to it further! 

 

-Kyle G 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Aiba
Tourist
5 0 0

My barcode query is still not working with iOS MobileBuySDK, is there a place I can contact the support team ? Thanks