Hi, I have a Int field orderNumber, how I can get ...
# prisma-whats-new
m
Hi, I have a Int field orderNumber, how I can get the max value of this field like
SQL select MAX(orderNumber)
d
graph.cool doesn't currently support any aggregations other than count
m
thanks
d
So right now, the options you have are to pull all of your order numbers and do the max on the client or join the schema extensions beta and write a function to get the max on the server side
m
Actually this seem to work fine
Copy code
{
  allDeliveryItems(first: 1, orderBy: deliveryNumber_DESC) {
    id
    deliveryNumber
  }
}
👍 1
d
Good call - that will work for situations where you want to find the maximum value of a field without any other complications. I will add this to my toolbox!