graphql-engine/server/src-lib/Hasura/RQL/DDL
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
..
Metadata ghc 9.2.5 2022-11-15 11:26:42 +00:00
Permission Collect Metadata dependencies in a Sequence rather than a list 2022-11-30 18:13:31 +00:00
Relationship Upgrade Ormolu to v0.5. 2022-11-02 20:55:13 +00:00
Schema Applies template transform in get_table_info metadata call 2022-12-20 23:39:49 +00:00
Webhook server: event trigger codecs 2022-12-15 20:38:21 +00:00
Action.hs Upgrade Ormolu to v0.5. 2022-11-02 20:55:13 +00:00
ApiLimit.hs Remove RQL/Types.hs 2022-04-27 13:58:47 +00:00
ComputedField.hs Upgrade Ormolu to v0.5. 2022-11-02 20:55:13 +00:00
CustomTypes.hs Upgrade Ormolu to v0.5. 2022-11-02 20:55:13 +00:00
DataConnector.hs Add display_name, release_name fields to MD Agent APIs - GDC-626 2022-11-18 04:19:08 +00:00
Endpoint.hs Remove RQL/Types.hs 2022-04-27 13:58:47 +00:00
EventTrigger.hs server: safely signal backend support for event triggers 2022-12-21 17:15:31 +00:00
GraphqlSchemaIntrospection.hs Remove RQL/Types.hs 2022-04-27 13:58:47 +00:00
Headers.hs server: event trigger codecs 2022-12-15 20:38:21 +00:00
InheritedRoles.hs Collect Metadata dependencies in a Sequence rather than a list 2022-11-30 18:13:31 +00:00
Metadata.hs server: remove a redundant argument passed to replaceMetadataV2 2022-12-16 10:21:04 +00:00
Network.hs server: Simplify BuildOutputs 2022-11-15 12:04:13 +00:00
OpenTelemetry.hs server: update metadata api for the OpenTelemetry exporter 2022-11-23 07:54:53 +00:00
Permission.hs Collect Metadata dependencies in a Sequence rather than a list 2022-11-30 18:13:31 +00:00
QueryCollection.hs Clean up Hasura.Prelude a bit 2022-10-03 21:50:53 +00:00
QueryTags.hs Replace BackendSourceMetadata type alias with a newtype 2022-08-29 00:59:18 +00:00
Relationship.hs Collect Metadata dependencies in a Sequence rather than a list 2022-11-30 18:13:31 +00:00
RemoteRelationship.hs Collect Metadata dependencies in a Sequence rather than a list 2022-11-30 18:13:31 +00:00
ScheduledTrigger.hs Rename get_event_invocations to get_scheduled_event_invocations 2022-11-03 10:23:11 +00:00
Schema.hs Import pg-client-hs as PG 2022-09-20 19:55:51 +00:00
SourceKinds.hs Add display_name, release_name fields to MD Agent APIs - GDC-626 2022-11-18 04:19:08 +00:00