2026-07 GetCollectionVariants returns incorrect variants for collections containing sub-collections

2026-07 GetCollectionVariants returns incorrect variants for collections containing sub-collections

Issue

I believe there is a bug in the Shopify Admin GraphQL API (2026-07) when using GetCollectionVariants to retrieve variants from a collection that contains a variant-scoped sub-collection.

Reproduction

I have two collections.

1. Child collection

The child collection contains exactly 3 variants:

  • Orange
  • 50 cm
  • Black

Running:

query GetCollectionVariants {
  productVariants(
    first: 250
    query: "collection:<child_collection_id>"
  ) {
    edges {
      node {
        title
        price
      }
    }
  }
}

correctly returns:

Orange
50 cm
Black

2. Parent collection

The parent collection contains the child collection as a sub-collection.

Running the same GetCollectionVariants query against the parent collection:

query GetCollectionVariants {
  productVariants(
    first: 250
    query: "collection:<parent_collection_id>"
  ) {
    edges {
      node {
        title
        price
      }
    }
  }
}

returns 11 variants instead of 3.

The 3 selected variants belong to 3 different products:

Product A → 1 of 4 variants selected
Product B → 1 of 3 variants selected
Product C → 1 of 4 variants selected

So there are 11 variants across those products, but only 3 variants are actually members of the child collection.

The parent collection query returns all 11 variants, including variants that are not part of the child collection.

Expected behavior

I would expect the parent collection to preserve the variant-level membership of its child collection:

Parent collection
└── Child collection
    ├── Orange
    ├── 50 cm
    └── Black

Therefore, GetCollectionVariants should return:

Orange
50 cm
Black

rather than all 11 variants belonging to the three products.

Evidence :

Child collection:

Parent collection:

@Liam-Shopify, I have seen your helpful resolutions in the past. Could you please help me with this as well?

Hey @Anirudh_Jain, quick reminder that our community guidelines mention not tagging anyone who has not yet engaged in this topic: Guidelines - Shopify Developer Community Forums

Looking into your report, I am able to replicate what you are seeing. I did find that querying the child collection directly gave me the right variants that I needed, so that could be used as a workaround.

I will look into finding out if this is expected and report back here when I know more.

Hi again @Anirudh_Jain, looking into this further, I can confirm that this is an issue that we are aware of.

I don’t have a timeline on a fix at this point, so querying the child collection directly is the best workaround for now.

Thanks @KyleG-Shopify. Digging into this further, the issue is actually not related to the API - it’s in the behaviour of how we create collections.

If we create a collection that references a collection of variants, it automatically inherits the products of those variants instead of just the targeted variants.

Steps to reproduce:

  1. Create a collection targeting variants only.
  2. Create a second collection that targets the collection created in step 1.

You’ll notice the step 2 collection ends up with the products instead of the variants of the child collection.

The ideal fix would be to make sure the parent collection inherits the correct variants from the child collection.

And yes, your workaround of querying the child collection directly is doable.

Hey @Anirudh_Jain, Thanks for sharing that additional context to help replicate. I’ll be sure to pass that on as well.