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

DanAtBonify
Shopify Partner
31 3 13

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 21 (21)
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
Excursionist
13 0 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
Excursionist
13 0 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
Tourist
7 0 2

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

akshuklait
Shopify Expert
5 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
6 0 1

I need this feature as well. Please!

Tom_Studio
New Member
4 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