A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
I've added a query filter to this request to filter for ACTIVE products, yet it does not affect the results which include ARCHIVED as well as ACTIVE etc.
I've tried using ACTIVE and active and some variations but no luck.
Can anyone tell me what I'm doing wrong?
query GiftFinderData { products(first: 10, query:"product_status:active") { edges { node { id title status descriptionHtml variants(first: 10) { edges { node { title price legacyResourceId } } } } } } }
Solved! Go to the solution
This is an accepted solution.
It should work with this:
query GetActiveProducts {
products(first: 10, query: "status:active") {
edges {
node {
id
title
status
totalInventory
priceRangeV2 {
minVariantPrice {
amount
currencyCode
}
maxVariantPrice {
amount
currencyCode
}
}
}
}
}
}
using `query: "status:active"`
I tested it, and archived products are not appearing for me now.
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
This is an accepted solution.
It should work with this:
query GetActiveProducts {
products(first: 10, query: "status:active") {
edges {
node {
id
title
status
totalInventory
priceRangeV2 {
minVariantPrice {
amount
currencyCode
}
maxVariantPrice {
amount
currencyCode
}
}
}
}
}
}
using `query: "status:active"`
I tested it, and archived products are not appearing for me now.
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
That's it, thank you @Liam - feel like a bit of an idiot missing this but your response has helped me figure out why I got this wrong too and a big part of this has clicked for me so I appreciate it.
Great to hear!
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