pimcore/data-hub

[Bug]: updating advanced many-to-many relationship fails when changing metadata

dkarlovi opened this issue · 1 comments

Expected behavior

Normal update.

Actual behavior

Key \"`auto_id`\" passed for upsert not found in data

Steps to reproduce

  1. Create a Product class with BOM advanced many to many relationship, column quantity (number)
  2. create two new object, say ID 111 and 123
  3. run the GraphQL query
mutation {
  updateProduct(
    id: 123
    input: {
      BOM: [
        {
          type: "object"
          id: 111
          metadata: [{ name: "quantity", value: "1" }]
        }
      ]
    }
  ) {
    message
    success
  }
}
  1. run the query again, but change the quantity value to 2
  2. now get the error
Key \"`auto_id`\" passed for upsert not found in data

This seems to be caused by the upsert not sending the correct keys when doing this update. The upsert here shouldn't be done against auto_id but against the metadata_un key.