I am trying to create a query in GraphQL on a data set that looks like this:
Data:
Id | version | name | value |
---|---|---|---|
1 | 1 | a | banana |
1 | 1 | b | boat |
1 | 2 | a | courgette |
1 | 2 | b | car |
2 | 1 | a | eggplant |
2 | 2 | a | fennel |
2 | 2 | b | ferry |
2 | 3 | f | french fries |
I want to create a query that only returns the rows where version has the highest value for each id. The desired output on the table above should be:
Id | version | name | value |
---|---|---|---|
1 | 2 | a | courgette |
1 | 2 | b | car |
2 | 3 | f | french fries |
Is this possible using GraphQL only or do I need to do this filtering within group after receiving all the data?