Get all product tags

Get all product tags

MaximRIT
Shopify Partner
14 1 1

Hello,

I want to get all products tags (especially that starts with some text but even in case it's not possible I can loop thru all tags and find tags I need). I found a GraphQL request for this here but this I found a strange problem: the maximum tags returned is 250 and looks like the pagination is not working: the argument "after" is not acceptable in this request - no other argument except "first":

 

{
  shop{
    productTags(first: 250 after:"Q09MT1VSU0VUfFBQMDhKSDE4Ng=="){
      edges{
        cursor
        node
      }
    }
  }
}

 

The question: how to get all tags, not only first 250?

Replies 3 (3)

Gregarican
Shopify Partner
1033 86 291

Rather than page through all the records, why not issue a bulk operation request? https://shopify.dev/tutorials/perform-bulk-operations-with-admin-api Then once the operation has completed you just download the resultant JSONL file with all records. It's a lot cleaner!

MaximRIT
Shopify Partner
14 1 1

Never used bulk operations yet. Just tried the one for the documentation in a Shopify GraphiQL App with all permissions allowed and API 2021-04 but it complains:

The change you wanted was rejected.

Maybe you tried to change something you didn't have access to.

If you are the application owner check the logs for more information.

Gregarican
Shopify Partner
1033 86 291

I believe that the GraphiQL app bases access scope off the logged-on Shopify shop user. So go into the Shopify settings for that user and see what access they have. If you can confirm it's everything under the sun and you've tried using other API versions in the app, then perhaps it's an internal issue on Shopify's end?