Maybe this is a stupid question, but how do you ma...
# prisma-whats-new
t
Maybe this is a stupid question, but how do you make a query to find a max value in Graphql? I get it that with graph.cool I can sort of do that using
first
and orderBy, something like:
Copy code
query MaxProposalNumber {
  allProposals(orderBy: number_DESC, first: 1) {
    number
  }
}
but it still returns an array. So is there a way do use a reduce function inside a graphql query so I don’t need to use it when resolving the value?
n
@teonimesic this is a great idea for now - we're looking to add better support for different aggregations in general though 🙂 https://github.com/graphcool/feature-requests/issues/70
👍 1