GraphQL product query using tags failing to return results

mwex501
Shopify Partner
11 0 5

Hello:

We are running into an issue with GraphQL product search using tags.
While this is working for most products, a good amount don't return even though they should qualify.

Consider this test case:

  • Our objective is to return all products that have the tag "prq_pers-indoor-light-3"
  • First we verified the products in Shopify admin by searching by tags. We found three products that have the tag "prq_pers-indoor-light-3", are active, on the online store channel, are set to continue selling when out of stock. I've attached images of a product that should qualify below.
  • When we run the below code, 0 products are returned, and no errors. We expect 3 products to return.

Feel free to visit the website https://ferrymorse.com/ and placing the code into the console to see the results.

Note that this seems to be working with most products (GraphQL query using product tags)


Any advice on how to get these products in the GraphQL call would be appreciated

 

Code for the call (plop in console of any page on  https://ferrymorse.com/ and see that no products are returned)

 

 var query = `{
    products(first:50, query: "tag:prq_pers-indoor-light-3") {
      edges {
        cursor
        node {
          id
          title
          productType
          availableForSale  
          compareAtPriceRange {
              maxVariantPrice {
                  amount
                  }
              minVariantPrice {
                  amount
                  }
          }
          handle
          onlineStoreUrl
          priceRange {
              maxVariantPrice {
                  amount
                  }
              minVariantPrice {
                  amount
                  }
              }
          tags
          images (first:1){
              edges {
                  node {
                      altText
                      height
                      id
                      width
                      src
                  }
              }
          }
          variants (first: 3){
              edges {
                  node {
                      id 
                  }				
              }
          }
        }
      }
    }
  }`;
  
  function apiCall(query) { 
		return fetch(
      '/api/graphql.json', 
      { method: 'POST', 
        headers: { 
          'Content-Type': 'application/graphql', 
          "Access-Control-Origin": "*", 
          'X-Shopify-Storefront-Access-Token': "75592721b9e165076f8c1c6b8a7d9e41" 
        },
        "body": query 
      }
    )
    .then(response => response.json()); 
  };
  
  console.log(apiCall(query));

 


21505269-6abde931888bd5ec2d213afc81759817.png21505317-ac73ea1673b4788e47135022b642932e.png21505509-0f99bab67968edc0511b8e73d791d90e.png

 

Reply 1 (1)

mwex501
Shopify Partner
11 0 5

Further on this issue:

 

When we try to use the same tags in a URL search, it works correctly (3 products are returned)

https://ferrymorse.com/collections/all/prq_pers-indoor-light-3

 

All the products that are failing seem to be PRE-ORDER (0/negative inventory but marked as continue to sell)