productTags, vendor & type does not return all data

There seems to be an issue where when using productTags against shop on the Admin API, the pageInfo is all incorrect.

EDIT: This issue is present on productTypes and productVendors too.

I’ve used the following and I know there are more than 250 tags yet hasNextPage returns false

{
    shop {
        productTags(first: 250) {
            edges {
                node
            }
            pageInfo {
                startCursor
                endCursor
                hasNextPage
                hasPreviousPage
            }
        }
    }
}
1 Like

Would be good to have someone from Shopify input here

You can apply up to 250 tags to each product, customer, transfer, blog post, order, and draft order. However, if you are on the Shopify Plus plan, you can have unlimited tags on your products. So hasNextPage field is false.

Sorry I don’t think you’ve understood the issue I’ve actually posted.

From your post, I understand that hasNextPage is returning false, but you know there are more than 250 tags.

When fetching product tags in Shopify, if you’re only receiving the first 250 tags and hasNextPage is false, it indicates that you’ve reached the limit of tags available for that resource(product).

If you’re not on a Shopify Plus plan, the first fetch will return all available tags(first:250), and hasNextPage will become false.

Are you using a Shopify Plus plan? With the Shopify Plus plan, it’s possible to have more than 250 tags, and pagination would be required to retrieve them.

Please link me to where it says this is limited when not on Plus.

Please see the link: https://help.shopify.com/en/manual/shopify-admin/productivity-tools/using-tags#tags-considerations

1 Like

Who knew! 250 tag limit! But what about vendors? That is not going to be limited yet the GQL seems to have the problem of not offering pagination correctly.

Yeah I’m not sure you’re understanding. productTags as well as vendors and types is to just retrieve all of them used across the store.

I believe the issue lies in the API because it only provides the 'first' argument, and the 'after' argument is not supported.

The ‘after’ argument is typically used to pass the next page cursor and fetch subsequent pages of results. However, using the 'after' argument results in the following error:

“Field ‘productTags’ doesn’t accept argument ‘after’.”

As an alternative, to retrieve all product tags, you can fetch all the products and extract the tags from each product individually.

That’s exactly the issue. Here is another post from the community site:

There it is mentioned that the lack of “after” support on the productVendors connection has been on the issues backlog since at least July. The lack of support on productTags has been there for years.

The workaround of fetching all products is not really feasible when you have over 10k products. I’d love to hear from the developers why they would leave something like this out and ignore it for so long.