Error when attempting to retrieve more than 250 customer tags from a shop

For one of our apps we’re using the GraphQL Admin API for retrieving customer tags on the shop. We found that we are only given the first 250, and we cannot retrieve any more after that.

There’s no explicit “250 customer tag limit”, but it’s limited by the first argument here in the Shop.customerTags connection. In this case the limit of first is 250 . When I tried to exceed this number I got an error back from Shopify.

Anyone know why this limit is in place, and if this is going to be opened up in the future? Thanks!

2 Likes

Shopify GraphQL queries have a limit of 250 across all objects. You’ll need to use edges and cursor to paginate through all objects.

There’s no after argument so paginating is impossible.

1 Like

If they added an after argument here that’d be awesome. Ideally there’d be a query argument too so we can filter through the tags.

1 Like

I recommend using the Shopify GraphiQL App, especially when trying to get an understanding of how an endpoint is structured or how it works.

A query field would be ideal, but you can paginate:

{
  shop {
    name
    customerTags(first: 250) {
      edges {
        node
      }
      pageInfo {
        hasNextPage
        hasPreviousPage
        startCursor
        endCursor
      }
    }
  }
}

What are we supposed to do with the cursors if there’s no after argument?

You can get the first 250 tags, but what about the next 250?

Good point! Sorry about that.

1 Like

Appreciate your willingness to help! I hope Shopify is able to address this

1 Like

Hey folks!

Thanks for flagging this limitation - I’ve reached out to the relevant product team and will update here with their recommendation.

3 Likes

Update: The product team confirmed this is a gap in our API and will be looking at how to support adding an after field for paginating. No ETA to share however - but will keep an eye on the issue internally.

2 Likes

Awesome, thanks @Liam-Shopify.