Anyone know what the best way would be to reorder multiple items in Prisma. Given an ‘order: Int’ on each item. Eg. A drag and drop list that persists the new order on drop. Looking at UpdateMany mutation - it appears you can only change all items with the same value and no way of using a dynamic value?
s
Sam Jackson
05/21/2018, 12:27 AM
@jasonhealy could you fetch their new order on the front-end and then use UpdateMany that way?
j
jasonhealy
05/21/2018, 8:33 AM
Thanks @Sam Jackson I thought of that but it appears you can only set the same value for all entities in an updateMany mutation. Eg set all or them to have an order of ‘2’ or set all of them to ‘unPublished:true’.
😔 1
jasonhealy
05/21/2018, 8:38 AM
I guess I could do most of the work on the GQL server with a combination of mutations / queries that updates each item in the list.