GraphQL query for filtering the products published after certain date

maviswa
New Member
6 0 0

Hi,

 

In REST ADMIN API, we can get the lists of products which got published after a certain date using the below API:

- https://your-development-store.myshopify.com/admin/api/2024-01/products.json?published_at_min=2014-04-25T16:15:47-04:00

 

How can we get the same result using GraphQL query?? I don't see similar parameter like 'published_at_min'.

 

Thanks In Advance,

Vidya

Reply 1 (1)

ShopifyDevSup
Shopify Staff
1310 214 454

Hey @maviswa

 

Thanks for sharing this. Currently, there isn't a published_at query filter available for product queries. 

 

Our documentation here lists the available queries you can use https://shopify.dev/docs/api/admin-graphql/2024-01/queries/products#argument-query 

 

I've let our product teams know that this would be useful to consider for future API updates. As a workaround at this time, you could use either the created_at or updated_at filters to get within the range you need, and then use the published_at sort filter to sort by the published date. 

 

Hope that helps. 

 

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