[BUG] New collection source - can't delete all sources from a collection

Hi,

Another symptom from the rushed release.

With the new collection source api, we have a new mutation to remove sources from a collection:

mutation CollectionRemoveSource($collection: CollectionUpdateInput!) {
  collectionUpdate(collection: $collection) {
    collection {
      id
      title
    }
    userErrors {
      field
      message
    }
  }
}
{
  "collection": {
    "id": "gid://shopify/Collection/123",
    "sourcesToDelete": ["gid://shopify/CollectionConditionsSource/123"]
  }
}

If the source we’re removing is the last source, it will return an userError:

          "message": "A condition based source must have at least one product selection or condition"

This is a problem, because it makes collection source management harder than it has to be. What to do in that situation when we want to remove the source? Should we add a dummy source? That itself cannot be empty anyway (that’s another problem cited here [Bug] Not possible to empty a non-empty selection-based collection via API ), so we have to make up by adding a random product or random condition, which is not desirable.


Also please not how the error message is broken. It says that the source must have at least 1 product - when we’re actually trying to remove it from a collection.


This makes even less sense when you take into account that actually a collection CAN be empty of sources.

For example if you delete an app owned source, it will be detached from the collections using it, if it was the last source, Shopify will happily leave the collection with 0 sources.

See a collection from which I removed all sources by deleting the only app-owned source that was on it - it continues to exist with 0 sources and 0 products:

query GetCollectionSources($id: ID!) {
  collection(id: $id) {
    id
    title
    sources {
      __typename
      id

    }
  }
}
  "data": {
    "collection": {
      "id": "gid://shopify/Collection/470239150311",
      "title": "123",
      "sources": []
    }
  },

The Ask:

Make it possible to delete all sources from a collection


Thank you

Thanks @Soufiane_Ghzal, we were able to reproduce this and we’ve confirmed it’s a valid issue.

I’ll follow up here once the fix is in place. From my testing it is working properly in unstable, but not in 2026-07.