这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@tirumaraiselvan
Copy link
Contributor

@tirumaraiselvan tirumaraiselvan commented Apr 26, 2019

Description

The new API adds an optional enable_manual BOOLEAN key to the spec. Default: False:

{
    "type" : "create_event_trigger",
    "args" : {
        "name": "testtrigger",
        "table": "users",
        "webhook": "https://httpbin.org/post",
        "insert": {
            "columns": "*"
        },
        "enable_manual": true
    }
}

Affected components

  • Server
  • Console
  • Docs

Related Issues

#1687

Solution and Design

  • Create a new v1 query type: invoke_event_trigger
  • Create a function which takes row data and related metadata and inserts into event_log.
  • Use above function to take params from invoke_event_trigger

Steps to test and verify

  1. Create a table:
curl 'http://localhost:8080/v1/query'  -H 'Content-Type: application/json'  -d '{"type":"bulk","args":[{"type":"run_sql","args":{"sql":"CREATE TABLE public.\"users\"(\"username\" text NOT NULL, \"real_name\" text NOT NULL, PRIMARY KEY (\"username\") );"}},{"type":"add_existing_table_or_view","args":{"name":"users","schema":"public"}}]}' 
  1. Create an event trigger with manual spec:
curl -H 'Content-Type: application/json' -X POST -d '{"type": "create_event_trigger", "args": {"name": "testtrigger", "table": "users", "update": { "columns" : ["username", "real_name"]},"insert": { "columns" : ["username"] }, "enable_manual": true, "webhook": "https://httpbin.org/post" } }' localhost:8080/v1/query
  1. Invoke an event manually:
curl -d '{"type": "invoke_event_trigger", "args": {"name": "testtrigger", "payload': {"new": { "username": "manualusername", "real_name": "manualrealname"}, "old": null}}}' localhost:8080/v1/query

Limitations, known bugs & workarounds

tirumaraiselvan and others added 30 commits March 13, 2019 15:33
…-event-triggers

# Conflicts:
#	server/src-rsr/migrate_from_12_to_13.sql
@hasura-bot
Copy link
Contributor

Review app for commit 06b074b deployed to Heroku: https://hge-ci-pull-2077.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2077-06b074b6

@hasura-bot
Copy link
Contributor

Review app for commit 52cfbd6 deployed to Heroku: https://hge-ci-pull-2077.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2077-52cfbd6d

@hasura-bot
Copy link
Contributor

Review app for commit 31b59e3 deployed to Heroku: https://hge-ci-pull-2077.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2077-31b59e38

@hasura-bot
Copy link
Contributor

Review app for commit 6180944 deployed to Heroku: https://hge-ci-pull-2077.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2077-61809441

@hasura-bot
Copy link
Contributor

Review app for commit 86baa31 deployed to Heroku: https://hge-ci-pull-2077.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2077-86baa314

@hasura-bot
Copy link
Contributor

Review app for commit 2bb9bf8 deployed to Heroku: https://hge-ci-pull-2077.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2077-2bb9bf82

Copy link

@rikinsk-zz rikinsk-zz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Console + Docs Approved

@hasura-bot
Copy link
Contributor

Review app for commit ca78de1 deployed to Heroku: https://hge-ci-pull-2077.herokuapp.com
Docker image for server: hasura/graphql-engine:pull2077-ca78de17

@0x777 0x777 merged commit 36e49ea into hasura:master May 13, 2019
@hasura-bot
Copy link
Contributor

Review app https://hge-ci-pull-2077.herokuapp.com is deleted

polRk pushed a commit to polRk/graphql-engine that referenced this pull request Feb 12, 2020
hasura-bot pushed a commit that referenced this pull request Jul 28, 2025
<!-- The PR description should answer 2 important questions: -->

### What

<!-- What is this PR trying to accomplish (and why, if it's not
obvious)? -->

<!-- Consider: do we need to add a changelog entry? -->

<!-- Does this PR introduce new validation that might break old builds?
-->

<!-- Consider: do we need to put new checks behind a flag? -->

### How

<!-- How is it trying to accomplish it (what are the implementation
steps)? -->

V3_GIT_ORIGIN_REV_ID: b207c27f7ca5b31165867311840a00fb538b40e5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c/console Related to console c/server Related to server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants