[BUG] - Graphql mutation `collectionUpdate` will not add products if at least one product does not exist

Steps to reproduce:

Given a collection exists and the collection has a source with 1 product already.

Perform the following mutation:

mutation CollectionUpdate($collection: CollectionUpdateInput!) {
          collectionUpdate(collection: $collection) {
            collection { id }
            userErrors { field message }
          }
        }

With an input like this one:

{"collection":{"id":"gid://shopify/Collection/470782378215","sourcesToUpdate":[
  {"condition":{"id":"gid://shopify/CollectionConditionsSource/25023971559",
    "inclusion":{"selectionsToAdd":[
      {"productId":"gid://shopify/Product/8868004724967"},
      {"productId":"gid://shopify/Product/8868004757735"},
      {"productId":"gid://shopify/Product/9999999999999"}
]}}}]}}

Where the product gid://shopify/Product/9999999999999 does not exist, while the other two products exist.

It will output:

{
  "data": {
    "collectionUpdate": {
      "collection": null,
      "userErrors": [
        {
          "field": [
            "collection",
            "sourcesToUpdate",
            "0",
            "condition",
            "inclusion",
            "selectionsToAdd",
            "2",
            "productId"
          ],
          "message": "Product does not exist"
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 10,
      "actualQueryCost": 10,
      "throttleStatus": {
        "maximumAvailable": 2000,
        "currentlyAvailable": 1990,
        "restoreRate": 100
      }
    }
  }
}

Expected results:

  • :cross_mark: collection is populated
  • :cross_mark: the existing products are added to the collection
  • :white_check_mark: userErrors indicates that the product 9999999999999 does not exist

Actual result:

1st issue, the collection comes null:

      "collection": null,

2nd issue:

  • User error indicates that one product is in error - this is expected
  • The other two products were NOT added to the collection

Why this is critical:

In the previous version with collectionAddProductsV2 non existing products where simply ignored

Races are very likely to occur if a product is deleted at the same time, especially when dealing with a large volume of products via a bulk operation.

It becomes extremely hard to work at scale with the new collection API and we have to rely on elaborated mechanisms to retry without the products in error.

Other cases

  • The same problem exists with the mutations:
    • collectionCreate
    • collectionConditionsSourceCreate
    • collectionConditionsSourceUpdate
  • While these mutation happily ignore the products that don’t exist:
    • collectionAddProductsV2

Hey @Soufiane_Ghzal - thanks for flagging this.

I’ve reproduced the behaviour on our end, and I’m working with the team that owns this area to confirm whether this all-or-nothing handling is expected for the new collection source mutations. Regardless of that outcome, I’m including your feedback about the impact on bulk operations and product-deletion races in that conversation. I’ll follow up here when I have more information.

Hi @Wes-Dev-Shopify that’s the last blocker before we can release, thanks a million for taking a look at it :folded_hands:

Hi @Wes-Dev-Shopify sorry for bothering you, but this is blocking our release at the moment and it would be helpful to know what’s the shopify position about this so we can act accordingly. Thank you

Hi @Wes-Dev-Shopify A response to understand the position of Shopify on this would be more than welcome.

We’re waiting on a feedback from shopify to wrap up the project and release update for 2026-07 which is crucial for our app.


I also want to add that the error message is not convenient to use. Especially in a bulk operation that would potential have 10s thousands of entries.

        {
          "field": [
            "collection",
            "sourcesToUpdate",
            "0",
            "condition",
            "inclusion",
            "selectionsToAdd",
            "2",
            "productId"
          ],
          "message": "Product does not exist"
        }

Two problems:

  1. The error data only contains indexes to the faulty products. No ID, it means that when we perform a bulk update we have to store the whole bulk operation and read it again to gain insight on which products are in error. If the same product is repeated across many lines we cant deduplicate it easily as well, we have to perform an index search for each error. proposed fix: provide the id of the product in error directly in the error message. That’s even more critical for bulk operations.

  2. The error message is in plain english, the only reliable piece of information is the field itself, there is not long term proof, reliable and machine readable way to know that this error is about a product that does not exist. proposed fix: add a reliable, machine readable way to know that the product does not exist, that will not change overtime.

Reminder of the core problem

These two issues are only symptoms of the initial problem. They would not be relevant in most of cases if we had the operation to simply add products and ignore products that don’t exist.


Ultimately what we need to know if that’s going to be fixed or not, and in which release it will land. The way we deal with that depends on this response.

Thank you.