CollectionToJoin on CreateProductMutation not working

Hello, I have a mutation that looks like this

mutation {
  productCreate(
    input: {
      handle: "closeout-50-off-ls2-bagger-solid-gloss-black-half-helmet",
      title: "CLOSEOUT 50% OFF LS2 Bagger Solid Gloss Black Half Helmet",
      productType: "",
      vendor: "LS2",
      tags: ["Brand_LS2", "Open Box", "Product Type_SALE", "Sale"],
      productOptions: [
        {
          name: "Size",
          values: [
            { name: "XS" },
            { name: "S" },
            { name: "XL" }
          ],
          position: 1
        }
      ]
    },
    collectionsToJoin: [
      "gid://shopify/Collection/285094805592",
      "gid://shopify/Collection/285093593176",
      "gid://shopify/Collection/285091528792",
      "gid://shopify/Collection/286035017816"
    ]
  ) {
    product {
      id
      title
    }
    userErrors {
      field
      message
    }
  }
}

And the collections aren’t being added to the product. The collections exist and the collection id’s are correct. Any help would be greatly appreciated!

Hi Dyllanjr,

If you try with adding the product to just one collection, is it still not working? Also - are the collections you’re referencing manual or automated collections? It’s possible if the product doesn’t meet conditions in an automated collection the product won’t be added. I can confirm this simpler mutation worked for me when adding to a manual collection:

mutation CreateProduct {
  productCreate(input: {
    title: "Newer Product",
    descriptionHtml: "

This is a nice new product.

",
    collectionsToJoin: "gid://shopify/Collection/476864020783"
  }) {
    product {
      id
      title
    }
    userErrors {
      field
      message
    }
  }
}