这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/src-lib/Hasura/RQL/Types/Subscribe.hs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ instance FromJSON CreateEventTriggerQuery where
else fail "only alphanumeric and underscore and hyphens allowed for name"
case insert <|> update <|> delete of
Just _ -> return ()
Nothing -> fail "must provide operation spec(s)"
Nothing -> fail "at least one among the insert/update/delete operation specs must be provided"
case (webhook, webhookFromEnv) of
(Just _, Nothing) -> return ()
(Nothing, Just _) -> return ()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
- description: Track table test_t1
url: /v1/query
status: 200
query:
type: track_table
args:
schema: hge_tests
name: test_t1
- description: 'Create event trigger with no operation specs provider: Error'
url: /v1/query
status: 400
response:
error: at least one among the insert/update/delete operation specs must be provided
code: parse-failed
path: $
query:
type: create_event_trigger
args:
name: t1_1
table:
schema: hge_tests
name: test_t1
3 changes: 3 additions & 0 deletions server/tests-py/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ def test_create_delete(self, hge_ctx):
def test_create_reset(self, hge_ctx):
check_query_f(hge_ctx, self.dir() + "/create_and_reset.yaml")

def test_create_operation_spec_not_provider_err(self, hge_ctx):
check_query_f(hge_ctx, self.dir() + "/create_trigger_operation_specs_not_provided_err.yaml")

@classmethod
def dir(cls):
return 'queries/event_triggers/create-delete'
Expand Down