graphql-engine/server/src-lib/Hasura
Jesse Hallett f4fa960ec6 server: safely signal backend support for event triggers
Hooks up event trigger codecs from #7237. This required fixing a problem where some backend types implemented `defaultTriggerOnReplication` with `error` which caused the server to crash when evaluating those for default values in codecs. The changes here add a type family to `Backend` called `XEventTriggers` that signals backend support for event triggers, and changes the type of `defaultTriggerOnReplication` to from `TriggerOnReplication` to `Maybe (XEventTriggers b, TriggerOnReplication)` so that it can only be implemented with a `Just` value if `XEventTriggers b` is inhabited. This emulates some existing type families in `Backend`. (Thanks to @daniel-chambers for this suggestion!)

I used the implementation of `defaultTriggerOnReplication` as a signal for event triggers support to prune the Metadata API so that event trigger fields will not appear in the OpenAPI spec for backend types that do not support event triggers. The codec version of the API will also not emit or accept those fields for those backend types. I think I could use `Typeable` to test whether `XEventTriggers` is `Void` instead of testing whether `defaultTriggerOnReplication` is `Nothing`. But the codec implementation will crash anyway if `defaultTriggerOnReplication` is `Nothing`.

I checked to make sure that graphql-engine-pro still compiles.

Ticket: https://hasurahq.atlassian.net/browse/GDC-521

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7295
GitOrigin-RevId: 2b2dd44291513266107ca25cf330319bf53a8b66
2022-12-21 17:15:31 +00:00
..
Backends server: safely signal backend support for event triggers 2022-12-21 17:15:31 +00:00
Base server: event trigger codecs 2022-12-15 20:38:21 +00:00
Cache server, pro: actually reformat the code-base using ormolu 2021-09-23 22:57:37 +00:00
Eventing server: add event_processing_time metric 2022-12-06 15:11:04 +00:00
GraphQL server/fix: stringify-numeric-types option in remote database relationships (fix #8387) 2022-12-19 14:04:58 +00:00
Incremental Further schema cache cleanups 2022-11-29 01:02:09 +00:00
Metadata server: event trigger codecs 2022-12-15 20:38:21 +00:00
RemoteSchema server: codecs for remote schemas metadata 2022-12-15 17:39:22 +00:00
RQL server: safely signal backend support for event triggers 2022-12-21 17:15:31 +00:00
Server Applies template transform in get_table_info metadata call 2022-12-20 23:39:49 +00:00
SQL server: delete the Cacheable type class in favor of Eq 2022-11-21 16:35:37 +00:00
Tracing server: support 128-bit trace ids 2022-09-20 02:50:06 +00:00
App.hs server: Destroy metadata database connection pools on shutdown. 2022-12-19 12:46:42 +00:00
EncJSON.hs server: tune builder runners, for ByteStrings we're about to send 2022-12-07 06:01:08 +00:00
GC.hs Upgrade Ormolu to v0.5. 2022-11-02 20:55:13 +00:00
HTTP.hs Add Data Connector agent request logging, improve error messages, and add tracing support [GDW-83] 2022-07-11 08:05:40 +00:00
Incremental.hs Further schema cache cleanups 2022-11-29 01:02:09 +00:00
Logging.hs server: add jwk-refresh-log type to default enabled logs 2022-11-08 16:48:44 +00:00
Name.hs server/postgres: fix the schema types conflict between aggregation predicates and table selection aggregates 2022-10-21 13:28:43 +00:00
PingSources.hs [server] regularly ping selected sources 2022-11-23 16:41:46 +00:00
QueryTags.hs server: support query tags for MSSQL data sources 2022-04-28 19:34:45 +00:00
Session.hs pro/server: add user_id of the collaborator in http_log 2022-12-15 07:49:37 +00:00
ShutdownLatch.hs multitenant: make shutdown logic more abstract 2022-11-23 07:53:19 +00:00
Tracing.hs Upgrade Ormolu to v0.5. 2022-11-02 20:55:13 +00:00