[GraphQL] CollectionCreate not return products/productsCount data on case insensitive condition

Topic summary

A user is experiencing an issue with the GraphQL collectionCreate mutation when using case-insensitive product title conditions.

The Problem:

  • Creating a collection with the condition "7 shakra Bracelet" (lowercase ‘s’) successfully adds the product titled "7 Shakra Bracelet" (uppercase ‘S’) to the collection in Shopify admin
  • However, the GraphQL response incorrectly returns productsCount: 0 and an empty products list
  • Using the exact title match works correctly and returns the expected product data

Key Points:

  • Shopify documentation explicitly states that collection conditions are case-insensitive
  • The collection itself is created properly and displays correctly in the admin interface
  • Only the API response data is incorrect

Suggested Workarounds:

  • Automatic collections may take time to populate after creation; querying the collection directly by ID afterward shows correct results
  • No built-in method exists to verify when population is complete
  • Consider implementing a delay/polling mechanism or using manual collections with product IDs instead of automatic collections with title-based rules

The issue remains unresolved as a potential API bug with case-insensitive matching in the immediate response.

Summarized with AI on November 16. AI used: claude-sonnet-4-5-20250929.

Hi I have a product, titled “7 Shakra Bracelet” and with the following query, I am able to include the product in the newly created collection and can see it in the collection page of my shop admin. But in the GraphQL response, the productsCount is 0 and the products list is empty. I also tested with the exact title “7 Shakra Bracelet”, in that case, I can get the correct response.

{
  "data": {
    "collectionCreate": {
      "userErrors": [],
      "collection": {
        "id": "gid://shopify/Collection/*************",
        "title": "TEST COLLECTIONCREATE",
        "descriptionHtml": "",
        "handle": "test-collectioncreate-6",
        "ruleSet": {
          "appliedDisjunctively": true,
          "rules": [
            {
              "column": "TITLE",
              "relation": "EQUALS",
              "condition": "7 shakra Bracelet"
            }
          ]
        },
        "productsCount": 0,
        "products": {
          "edges": []
        }
      }
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 54,
      "actualQueryCost": 14,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 986,
        "restoreRate": 50
      }
    }
  }
}
mutation CollectionCreate($input: CollectionInput!) {
  collectionCreate(input: $input) {
    userErrors {
      field
      message
    }
    collection {
      id
      title
      descriptionHtml
      handle
      ruleSet {
        appliedDisjunctively
        rules {
          column
          relation
          condition
        }
      }
      productsCount
      products(first: 10) {
        edges {
          node {
            title,
            id,
            images(first: 1) {
              edges {
                node {
                  id
                }
              }
            }
            title
          }
        }
      }
    }
  }
}
{
  "input": {
    "title": "TEST COLLECTIONCREATE",
    "ruleSet": {
      "appliedDisjunctively": true,
      "rules": {
        "column": "TITLE",
        "relation": "EQUALS",
        "condition": "7 shakra Bracelet"
      }
    }
  }
}

No, nothing wrong with capitalization. Shopify states that condition is case-insensitive and as I mentioned in my post, the collection was successfully created with the product included, the only problem was no product returned from the response.


Set conditions based on product title, variant title, type, or vendor

You can add a condition to include a product in a collection based on the product’s title, variant title, type, or vendor. You can select from the options in the second drop-down list to control how a product needs to match the condition value that you enter in the third field. The text that you enter in the third field is compared to your products according to the condition’s settings, and matching products are included in the collection. The condition is not case-sensitive. https://help.shopify.com/en/manual/products/collections/automated-collections/auto-select

Hey @emilyman

Sometimes the collections can take a moment to populate. Are you still seeing 0 when you query the collection directly (outside of a create)? If so, please DM me store details.

@SBD Thanks for clarifying. I can see the collection with direct query by id, but is there any way to verify the population has finished? Especially if the store has large amount of products, it should take a longer time?

Unfortunately not with automatic collections - you might need to implement a delay / poll.

Are you able to use a manual collection / provide the Product ID(s) instead of the title?