How to GraphQL query string match

Solved
Highlighted
New Member
1 0 0

I'm wondering if graphQL could query exact string match, for example:

query {
   products(first: 50, query: "tag:'product-family:unique family one' tag:'master-product:TRUE'") {
    edges {
      node {
        tags        
      }   
    }
  }
}

There's only one product-family tag for each product. The above query outputs all the right products PLUS products that contain "product-family:unique family one lorem" , which I don’t want.


It seems like the query is doing partial string match rather than exact string match, if that makes sense. 

 

Any idea how to perform exact string match query? 

I've checked out these two links and found nothing:

https://shopify.dev/concepts/graphql/queries 
https://shopify.dev/concepts/about-apis/search-syntax 

0 Likes
Highlighted

Success.

Shopify Staff
Shopify Staff
387 72 54

Hey @YR 

 

There is a good explanation of this you can find here:https://community.shopify.com/c/Shopify-APIs-SDKs/GraphQL-Admin-API-Search-Products-by-Tag/m-p/51244...

 

Unfortunately, in this case tags are partially matched, so additional filtering will be needed or updating the naming conventions. 

Vix | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 


0 Likes