A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
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:
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));
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)