Goal: Create and publish smart collections (rule-based) via Shopify Flow using the Admin API’s collectionCreate when a product status changes; scale to hundreds of collections.
Problem: The API call creates a manual collection, does not apply rules, and does not publish the collection.
Details seen in payload: ruleSet was outside the input object (and misspelled/spaced as “ru leSet”); relation used “IS EQUAL TO” instead of the expected “EQUALS.” Images indicate a JSON parse error.
Advice/updates:
Test the mutation in GraphiQL first to catch syntax/validation errors.
Place ruleSet inside the input object with correct field names and values (e.g., relation: EQUALS; column: TAG).
Include userErrors in the mutation response to surface validation issues.
Status: No confirmation yet that the corrected mutation creates a smart collection or handles publishing. Publishing specifics were not addressed in the reply and remain an open item.
Summarized with AI on December 17.
AI used: gpt-5.