cambiatus / backend

Cambiatus GraphQL API
GNU Affero General Public License v3.0
20 stars 18 forks source link

Product creatorId changes when updating categories as admin #277

Closed henriquecbuss closed 2 years ago

henriquecbuss commented 2 years ago

As part of our new shop update with categories, we're going to allow community admins to edit the categories from products in the shop. This is being implemented in https://github.com/cambiatus/frontend/pull/805.

However, when submitting a product mutation as the admin of the community, the creatorId field of the product changes from the previous owner to the community admin.

For example: I edited the categories of a product created by @lucca65 on the Buss community. The mutation was something like this (these aren't the correct category ids):

mutation {
  product(id: 72, categories: [1, 2, 3]) {
    id
  }
}

And now, after submitting that mutation, the product belongs to me instead of @lucca65 (who created the product)