Support of aggregate function in GraphQL

后端 未结 3 1909
走了就别回头了
走了就别回头了 2020-12-15 17:08

I\'m am very interested by GraphQL for an analytic solution (think of an webapp displaying graphs). But I cannot find any examples of GraphQL using aggregate function. This

3条回答
  •  攒了一身酷
    2020-12-15 18:03

    Check out https://github.com/niclasko/Cypher.js (note: I'm the author)

    With relevance to the question. It can be used to query and aggregate over data from JSON endpoints:

    load json from "http://url/person" as l return l.age, count(1)
    

    There’s even a bar chart function:

    load json from "http://url/person" as l return barchart(toint(l.age)) as age_distribution
    

    Here's an example of querying a complex JSON document and performing aggregate analysis on it:

    Cypher.js JSON query example

提交回复
热议问题