Can graphql return aggregate counts?

前端 未结 5 1094
说谎
说谎 2021-02-03 16:58

Graphql is great and I\'ve started using it in my app. I have a page that displays summary information and I need graphql to return aggregate counts? Can this be done?

5条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-03 17:41

    There's no automatic aggregate function in GraphQL itself.

    You can add a field called summary, and in the resolve function calculate the totals.

提交回复
热议问题