Hi Shopify team,
The new collections model supports collections containing specific variants rather than entire products targetType: VARIANTS. However, the Admin GraphQL API does not appear to provide equivalent collection membership fields on ProductVariant.
At the product level, this is straightforward:
Product.collectionslets us request just the collection IDs.Product.inCollection(id:)returns a membership Boolean.
These provide a lightweight way to read membership without enumerating product variants.
At the variant level, neither equivalent exists. Checking the parent product is insufficient because a collection can include one variant while excluding its siblings.
The available workarounds - filtering productVariants by collection or querying Product.variantsInCollection - require additional searches or retrieving and paginating variant lists simply to determine membership.
Is there a direct variant-level membership field that I’ve missed? If not, could Shopify expose ProductVariant.collections and/or ProductVariant.inCollection(id:), ideally also supporting batch checks?
For example: Shopify supports up to 2,048 variants per product, which makes this workaround even more expensive. Checking 100 variants against 100 collections through ProductVariant.product.variantsInCollection(...) can create up to 10,000 nested connections, each potentially returning thousands of sibling variants requiring pagination—just to determine whether one specific variant belongs.
This can exceed GraphQL query-cost limits or require numerous requests that trigger throttling. A direct variant-level membership check would avoid retrieving those sibling variants.