FROM CACHE - en_header

Cannot get all product tags from GraphQL API { shop => productTags }

DanAtBonify
Shopify Partner
35 3 15

It appears that there is no way to pull all product tags from a store with more than 250 product tags when using the

{ shop => productTags } connection.

 

Example GraphQL API call:

{
  shop{
    productTags(first: 250){
      pageInfo{
        hasNextPage
      }
      edges{
        node
        cursor
      }
    }
  }
}

 

Issue #1

{ pageInfo => hasNextPage } always returns false, even if there are more than 250 product tags.

 

Issue #2

The "after" argument is not supported for productTags, so there is no way to pass a cursor to paginate the results, even through you are able to get a "cursor" back in the query result.

 

Issue #3

The "first" argument only accepts a limit of 250. If this limit was increased for this connection, we could at least grab more tags. The query cost is very low which makes me think all of the tags are stored in a simple way, which means we should be able to grab ALL tags for low query cost. A neat suggestion could be a constant that would allow you to pull ALL tags at once. E.g.:

{
  shop{
    productTags(first: ALL){
      edges{
        node
      }
    }
  }
}

 

---

 

These issues would technically apply to the productTypes and productVendors connections as well. But I imagine stores use more tags than those other attributes.

Replies 22 (22)
GuidelinesApp
Shopify Partner
5 0 1

Hi Dan,

 

Did you ever find a solution? Being able to retrieve all unique tags for a shop would be very helpful and I really like your suggestion. 

 

Mariano

3 Revolutions | Guidelines Product Finder App
paoloc
Shopify Expert
2 0 0

Any solution about pagination? 

Alex
Shopify Staff
Shopify Staff
1561 81 325

This appears to be an issue, it looks like we missed this. I've reported this as an issue and decided not to lock the thread (bumped after a significant amount of time) since I intend to report back here when a solution is implemented.

Alex | 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 the Shopify Help Center or the Shopify Blog

LePong
Excursionist
25 1 16

Amazing to hear!

I hope I had a hand in necro'ing this issue with my new post linking to this and asking about the same issue 🙂

I look forward to getting this solution from you guys.

Thanks @Alex 

dma550
Tourist
12 0 3

@Alex I also have this issue with ProductVendor.  It states next page is false even when there are, and doesn't support the "after" tag.

tahafarooqui
Tourist
8 0 4
Islam_Mohamed
Shopify Partner
4 0 0

@Alex  Is there any updates about this issue, i see that its already exist on Latest API, RC and the unstable API?

JohnAtBonify
Shopify Partner
136 7 35

Bump. 

 

Still getting complaints from our customers about this Shopify bug. 😞

3Revolutions
Shopify Partner
14 1 7

Hey Alex,

It has been over a year and this functionality would extremely valuable to all app developers. Any update from your end? 

Mariano Ferrario | Founder
3 Revolutions | Guidelines Product Finder App
power777
Tourist
9 0 4

We have solved this issue by creating a template that loops through all tags and collections and renders a list of all unique tags and collections.

3Revolutions
Shopify Partner
14 1 7

Thanks @power777 . We also have a similar solution where we loop through all products and construct the set of unique tags. We have had it for years and works well, but as we are getting larger and larger customers it is becoming less efficient and it would be nice to have a simple API call that would return all unique tags.  

Mariano Ferrario | Founder
3 Revolutions | Guidelines Product Finder App
dma550
Tourist
12 0 3

I had the same issue with ProductVendors and solved it the same way.  Pulling all 30K products and getting their vendors, then recording the distinct list of vendors.  I hit throttling 10-12X during this process because I am pulling all orders.  It sure would be nice to be able to use the GraphiQL API as it was designed vs. having to draw down thousands of rows and sift through them.

3Revolutions
Shopify Partner
14 1 7

@Alex Any update on this issue? 

Mariano Ferrario | Founder
3 Revolutions | Guidelines Product Finder App
okair
Tourist
8 0 2

Also need this!! This seems like very basic functionality that Shopify should be able to implement 

@Alex please let us know if this work is in progress

musubi
Shopify Partner
8 0 2

Could also use this. Any chance of adding cursor field and after argument customerTags and productTags?

akshuklait
Shopify Expert
6 0 2

Hi  @Alex , Shopify  
Did you got any resolution from dev team. We need badly pagination option.

 

yahya92
New Member
2 0 0

My 2nd day as Shopify API developer and I already need this feature implemented 🙂

andrewrobbins
Shopify Partner
8 0 1

I need this feature as well. Please!

Creator of ShopWP https://wpshop.io
Tom_Studio
Shopify Partner
5 0 0

Hi @Alex,

Could you give us any news ?

It seems that on version 2021-10 this does not work either.

Please let us know.

All the best 😉