PRODUCT mutation returns invalid collections array!

Highlighted
Shopify Partner
38 0 0

I'm experiencing a very very weird issue.

When running a huge bulk update of products (>10K) then I get an invalid return for the collections.

 

Here is the product mutation that I use:

  mutation productUpdate($input: ProductInput!) {
    productUpdate(input: $input) {
      product {
        id
        tags
        collections(first: 250) {
          edges {
            cursor
            node {
              id
              productsCount
            }
          }
          pageInfo {
            hasNextPage
          }
        }
      }
      userErrors {
        field
        message
      }
    }
  }


Most of the time the return is perfect on spot, but sometimes I end up with data that is incorrect in the collections.

So for a product that should look like this:

 

{
  "data": {
    "product": {
      "id": "gid://shopify/Product/1603410296885",
      "tags": [
        "__beschaffenheit__fast",
        "__beschaffenheit__regular",
        "__beschaffenheit__slow",
        "__grosse__1",
        "__grosse__2",
        "__grosse__3",
        "__grosse__5"
      ],
      "collections": {
        "edges": [],
        "pageInfo": {
          "hasNextPage": false
        }
      }
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 253,
      "actualQueryCost": 3,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 997,
        "restoreRate": 50
      }
    }
  }
}

I actually get:

{
    "id": "gid://shopify/Product/1603410296885",
    "tags": [
    	"__beschaffenheit__fast",
    	"__beschaffenheit__regular",
    	"__beschaffenheit__slow",
    	"__grosse__1",
    	"__grosse__2",
    	"__grosse__3",
    	"__grosse__5"
    ],
    "collections": {
    	"edges": [
    		{
    			"cursor": "eyJsYXN0X2lkIjo2NTc3MDU4NjE2NSwibGFzdF92YWx1ZSI6IjY1NzcwNTg2MTY1In0=",
    			"node": {
    				"id": "gid://shopify/Collection/65770586165",
    				"productsCount": 2
    			}
    		},
    		{
    			"cursor": "eyJsYXN0X2lkIjo2NTc3MTQwNTM2NSwibGFzdF92YWx1ZSI6IjY1NzcxNDA1MzY1In0=",
    			"node": {
    				"id": "gid://shopify/Collection/65771405365",
    				"productsCount": 120
    			}
    		},
    		{
    			"cursor": "eyJsYXN0X2lkIjo2NTc3MTQzODEzMywibGFzdF92YWx1ZSI6IjY1NzcxNDM4MTMzIn0=",
    			"node": {
    				"id": "gid://shopify/Collection/65771438133",
    				"productsCount": 873
    			}
    		},
    		{
    			"cursor": "eyJsYXN0X2lkIjo2NTc3MTU2OTIwNSwibGFzdF92YWx1ZSI6IjY1NzcxNTY5MjA1In0=",
    			"node": {
    				"id": "gid://shopify/Collection/65771569205",
    				"productsCount": 120
    			}
    		}
    	],
    	"pageInfo": {
    		"hasNextPage": false
    	}
    }
}

Has anybody experienced something similar?

Any idea how to fix this?

0 Likes
Shopify Partner
38 0 0

I'm having a real hard time to replicate the issue.
It seems to happen randomly under very high load.

0 Likes