GraphQL Returning Incorrect Data When Collection With Many Products Exists

igor_luxcom
Shopify Partner
2 0 1

Hello,

 

Running across a weird issue that is only occurring whenever a collection with a large number of product exists. 

 

Here is the GraphQL query being used:

 

{
    collections(query: "collection_type:custom") {
        edges {
        node {
            id
            title
            productsCount
            products {
                edges {
                    node {
                        id
                    }
                }
            }
            metafields {
                edges {
                    node {
                        id
                        type
                        value
                        key
                        namespace
                    }
                }
            }
        }
        }
    }
    productVariants {
        edges {
            node {
                id
                sku
                product {
                    id
                }
            }
        }
    }
}

 

 

Note that it is running as a bulkOperationRunQuery. 

 

The expectation is that it returns all custom collections (including respective id, title, number of products, and ID of all products in this collection) and all product variants (including id, SKU, and respective product's id).

 

When a collection with a large number of products does not exist, it returns the expected values: 

Screenshot 2023-09-05 133226.png

 

However, when a collection with a large number of products (600+ in this case), the returned JSONL is broken and does not match the requested GraphQL parameters:

Screenshot 2023-09-05 133722.png

 

As you can see, it no longer returns any collection data (id, title, products count) but instead just returns the information of the products included in the collections.

 

This seems like a bug in Shopify. 

 

Open to suggestions on what we might be doing wrong or how would we go about getting this bug corrected.

 

 

Replies 2 (2)

SBD_
Shopify Staff
1829 269 407

Hey @igor_luxcom 

 

Can you please DM me store details so I can attempt to replicate?

Scott | Developer Advocate @ Shopify 

igor_luxcom
Shopify Partner
2 0 1

DM'd!

 

Thanks.