1
0
mirror of https://github.com/hasura/graphql-engine.git synced 2024-12-15 09:22:43 +03:00
graphql-engine/server/src-lib/Data
David Overton 9921823915 GDC-189 custom aggregations
>

## Description
->

This PR allows DC agents to define custom aggregate functions for their scalar types.

### Related Issues
->

GDC-189

### Solution and Design
>

We added a new property `aggregate_functions` to the scalar types capabilities. This allows the agent author to specify a set of aggregate functions supported by each scalar type, along with the function's result type.

During GraphQL schema generation, the custom aggregate functions are available via a new method `getCustomAggregateOperators` on the `Backend` type class.
Custom functions are merged with the builtin aggregate functions when building GraphQL schemas for table aggregate fields and for `order_by` operators on array relations.

### Steps to test and verify
>

• Codec tests for aggregate function capabilities have been added to the unit tests.
• Some custom aggregate operators have been added to the reference agent and are used in a new test in `api-tests`.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/6199
GitOrigin-RevId: e9c0d1617af93847c1493671fdbb794f573bde0c
2022-10-27 00:44:06 +00:00
..
Aeson Moving kriti function references into a single module for coordination of availability 2022-07-21 07:07:29 +00:00
HashMap/Strict GDC-189 custom aggregations 2022-10-27 00:44:06 +00:00
List Clean up Hasura.Prelude a bit 2022-10-03 21:50:53 +00:00
Parser server/parsers: Reduce usages of "utils"-like functions. 2022-07-06 07:56:35 +00:00
Text server: switch to ghc 9.2 (2nd try) 2022-10-06 09:09:01 +00:00
URL Weeding (2/?) 2022-06-09 16:40:49 +00:00
Environment.hs Allows for mock env vars in test-webhook-transform endpoint 2021-12-09 07:59:46 +00:00
SerializableBlob.hs server: Refactor TByteString to SerializableBlob 2022-06-17 09:57:38 +00:00
SqlCommenter.hs server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
Trie.hs Extract generic containers from the codebase 2022-03-01 16:04:22 +00:00