Anyone know what the best way would be to reorder ...
# orm-help
j
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
@jasonhealy could you fetch their new order on the front-end and then use UpdateMany that way?
j
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
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.
n
you can use floats, that simplifies things
👍 1