Hello guys, I’m wondering what’s the syntax we should use for the “query” argument many of the Objects offer. The documentarion say “String” and passing for example “Accessories” to find Products in the “Accessories” collection works. But it feels a little loose. Is there a way to make it more explicit that I’m only searching for collections called “Accessories”?
This was just an example, any information on the topic will contribute a lot! Thanks!
Unfortunately our guy didn’t say much cause he himself didn’t have a lot of experience with this API. I’m hoping we’ll see more developments on it soon as it’s a killer feature on Shopify’s tool belt
I’m noticing some inconsistencies in querying products (api versoins: 2019-04 through 2010-10)
I have a product with
title: Thing
sku: abc-123
Searching with a prefix query acts different depending on field:
query: “title:Thi*” returns the product
query: “title:Thi” no results
query: “sku:abc*” no results
query: “sku:abc” returns the product
query: “abc” returns the product
query: “abc*” returns the product
Yes, most consistent across the GraphQL implementation is inconsistency. Maybe the lack of documentation is to hide this problem.
The Search Syntax link that keeps getting dropped into GraphQL query posts is not helpful. The examples in it don’t work on GraphQL because many of the fields don’t support query. For example, query:“name:Bob”, in the search docs won’t work because Shopify’s GraphQL implementation does not allow for querying of the name, but it does support querying the email address… what??
This in addition to the GraphQL interface returning ‘firstName’ but the search doc examples refer to ‘first_name’… So even it was queryable, which would it be???
Now that Shopify has adopted versioned API’s, as their GraphQL implementation so inconsistent and poorly documented, they should be tagging it as BETA until it’s ready for rage-free adoption by partners/customers. Its simply not fully baked…
I’d like to thank everybody who contributed here. You have no idea how immensely you’ve helped me.
I don’t understand why the Shopify documentation is so insanely horrific.
I volunteer to re-build the entire documentation. Seriously.
There are a number of shining examples across the web. Both ruby-lang.org and rubyonrails.org (oh man, especially RoR’s documentation) are the epitome of brilliantly designed documentations, guides, and tutorials.
Compared to Shopify’s docs, both Python and PHP have god-level documentation.
I find myself saying this often enough, so I’ll repeat it here because it’s true: It took me 3 full months of reading and re-reading shopify’s documentation, taking the nearly worthless “fun courses” in the ever-so misleadingly named “Partner’s Academy”, and pouring through the blogs and forums to become moderately efficient. I can guarantee you that I could re-write the documentation in a manner that would get 90% of new Shopify developers up to my current skill level in less than 3 weeks. Most, in under a week - zero exaggeration. THAT is how confusing and poorly organized the docs are.
First time through I was like, “Wait - they have what? 1, 2, 3 … 57 different API’s? How - what? Does that even make sense?”
Come to finally realize everything’s an API here. So when you have the Discounts API, Customer API, and the Storefront API and the REST API. API’s within API’s, surrounding the API’s and within the APIs. APIs to connect APIs that aren’t even APIs. Like seriously. How insanely confusing can you make things?
So yes - totally - I suffered unnecessarily for months; I will totally rewrite these docs. Obviously not for free; but I’ll make em’ shine. Shopify’s documentation will be legendary. People will want to learn Shopify development just so they can read the legendary docs.
Anyway - nuffsed. Thank you everybody for everything you’ve laid out here. Bookmarked.
yes, surprise surprise – shopify, under the hood, is revealed to be an abomination.
i encountered the same issue and this thread while building my typescript library shopify-shepherd, which is a replacement for the official shopify-buy sdk – here’s what i’ve discovered for our shared quest of searching products:
the “products” query FAILS:
{
products(first: 10, query: "(tag:appetizer) AND (tag:indian)") {
edges {
node {
id
title
}
}
}
}
but this “search” query WORKS:
{
search(first: 10, query: "(tag:appetizer) AND (tag:indian)") {
edges {
node {
... on Product {
id
title
}
}
}
}
}
in this thread i hear talk about needing a “Search & Discovery” app, but after installing it, it doesn’t look useful for our case, it’s something to do with customizing themes or whatever