Development discussions around Shopify APIs
Hi guys ! I'm trying to migrate to the new api, but I can't fetch products filtering by their title
API 2019-04 (Works fine, has results 🍻)
Url: https://{{api_key}}:{{api_password}}@{{store_name}}.myshopify.com/admin/api/2019-04/products.json?title=value
Results :
{ "products": [ {..}, {..}, {..}, {..}, {..}, {..}, ] }
API 2019-07 (No results 🥺)
Url: https://{{api_key}}:{{api_password}}@{{store_name}}.myshopify.com/admin/api/2019-07/products.json?title=value
Results :
{ "products": [] }
The docs : https://help.shopify.com/en/api/reference/products/product?api[version]=2019-07
In the docs title is supported ¿Any ideas ?
Solved! Go to the solution
This is an accepted solution.
Hi ! I founded my "problem" here https://help.shopify.com/en/api/versioning/release-notes/2019-07
Searching by partial title is not supported now, the 2019-07 changelog:
Requests that pass a value for title will match only if the value is the same as the complete title. Partial matches aren't supported.
This is an accepted solution.
Partial matching has moved to the GraphQL endpoint. To match all products containing "partial", you'd provide the query:
*partial*
For example:
{ products(first: 10, query: "title:*partial*") { edges { node { id title } } } }
This is an accepted solution.
Hi ! I founded my "problem" here https://help.shopify.com/en/api/versioning/release-notes/2019-07
Searching by partial title is not supported now, the 2019-07 changelog:
Requests that pass a value for title will match only if the value is the same as the complete title. Partial matches aren't supported.
This is an accepted solution.
Partial matching has moved to the GraphQL endpoint. To match all products containing "partial", you'd provide the query:
*partial*
For example:
{ products(first: 10, query: "title:*partial*") { edges { node { id title } } } }
Hi,
I need to search using partial product title. As per your comment I had tried *partial* but it does not seem to work.
This is my payload
{ products(first: 10, query: "title:*av*") { pageInfo { hasNextPage hasPreviousPage } edges { cursor node { title featuredImage { transformedSrc } } } } }
Could you help me why it is not returning anything?
Thanks,
Sourav
Hi,
Could you please tell me how I can report to Shopify?
Thanks,
Sourav
There is nothing to report to Shopify here souravchandra. That GraphQL with the query search in the title does in fact work.
You might want to use a tool like Insomnia to validate your work. It allows you debug these things with a lot of certainty about where a problem may like. Makes it easy to change API versions, etc.
I tried with Shopify's own GraphiQL app. It works for prefix search queries but not for partial queries. I mean my products are say test1 and test2, it works when I specify 'title:t*' but not for 'title:*es*'
Oh well. I see ... so use the search endpoint then. It is more for general queries like that. That is what Shopify uses too. It is not perfect, no, far from it, but is more loose and might help you. You will probably hate that too. Searching for such small fragments is not too interesting for the most part.
@souravchandra wrote:I tried with Shopify's own GraphiQL app. It works for prefix search queries but not for partial queries. I mean my products are say test1 and test2, it works when I specify 'title:t*' but not for 'title:*es*'
User | RANK |
---|---|
10 | |
5 | |
3 | |
3 | |
3 |
Photo by Marco Verch Sales channels on Shopify are various platforms where you can sell...
By Ollie May 25, 2023Summary of EventsBeginning in January of 2023, some merchants reported seeing a large amo...
By Trevor May 15, 2023With 2-Factor Authentication being required to use Shopify Payments, we’re here to help yo...
By Imogen Apr 26, 2023