GraphQL querying products by multiple tags not returning accurate results

Jason_Wandrag
Shopify Partner
2 0 0

Hello, I am hoping someone can help with this.

We are trying to fetch products that match multiple tags using the query param of the product query.

 

From the images below, I am not able to get the product information, even though I have correctly referenced the tags I need. This has broken a few products throughout our store

 

Screenshot 2023-07-04 at 11.00.25.pngScreenshot 2023-07-04 at 11.00.55.png

Replies 10 (10)

Liam
Shopify Staff
2731 302 778

Hi Jason,

 

If you try with the following format (without the AND) is it still not working?

 

{
  products(first: 10, query: "tag:grouping_id_1369815 tag:test123") {
    edges {
      node {
        title
        tags
        description
      }
    }
  }
}

If this doesn't work we can troubleshoot further.

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me 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

Jason_Wandrag
Shopify Partner
2 0 0

Hey Liam, 

Thanks for getting back to me. I have updated the query and I still get no results back from shopify. I have attached an image to show the response

Screenshot 2023-07-04 at 14.01.43.png

Liam
Shopify Staff
2731 302 778

Hi again Jason,

 

Could you try using `product.tag` instead of just `tag` in the query to see if this works? So the query would look like:

 

{
  products(first: 10, query: "product.tag:grouping_id_1369815 product.tag:test123") {
    edges {
      node {
        title
        tags
        description
      }
    }
  }
} 

 

Let me know if this works. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me 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

shaun49995
Shopify Partner
5 0 0

We're experiencing the exact same thing - 2 of our stores are not returning any new data from graphQl - please sort this out asap.

Liam
Shopify Staff
2731 302 778

Hi Shaun49995 and Jason,

 

Our team are working on a fix for this - will update here once it's resolved. Appreciate your patience here!

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me 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

shaun49995
Shopify Partner
5 0 0

Any update on this? It's been down for a few days and our stores are losing revenue due to products not working on the front-end.

Liam
Shopify Staff
2731 302 778

Hi Shaun, could you try changing the query to use `product.tag` instead of just tag . 

 

eg:

 

 

{
products(first: 10, query: "product.tag:test123 product.tag:test456") {
edges {
node {
title
tags
description
}
}
}
}

 

 

Let me know if this is not working for you,

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me 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

shaun49995
Shopify Partner
5 0 0

The product query in its entirety does not function as expected. We've had to move to the search query as a workaround which slows down our apps. All our apps using the product query are now broken and need to be refactored due to this Shopify issue. It's ridiculous that this has not been solved yet.

Various different posts, slacks messages etc. of people complaining about the same. OUR STORES ARE LOSING REVENUE, and all Shopify has to give are workarounds that don't even work.

As a plus partner, we're considering moving away from Shopify due to the instability. Get this fixed, and keep everyone in the loop as to what is going on.

Liam
Shopify Staff
2731 302 778

Hi again Shaun,

 

Appreciate your patience while we work on this. Can you DM me with examples of stores where this behaviour is happening? 

 

Thanks,

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me 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

Liam
Shopify Staff
2731 302 778

Hi again Shaun,

 

It's possible this behaviour is related to how elastic search indexing occurs. Indexing happens asynchronously and completion of an index update can take few minutes - are you still seeing this issue happening if you wait ~10 minutes after updating the tags? The following query should be working:

 

{
  products(first: 10, query: "tag:grouping_id_1369815 AND tag:test123") {
    edges {
      node {
        title
        tags
        description
      }
    }
  }
}

Please try this after waiting ~10 minutes after updating/ adding tags, and if you're still seeing this issue, please let us know.

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me 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