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

Conversation

@tirumaraiselvan
Copy link
Contributor

@tirumaraiselvan tirumaraiselvan commented Sep 27, 2018

Description

We want to give users ability to listen on events only when certain columns change for a record. Currently, we send events when the record changes even if certain columns did not change.

What component does this PR affect?

  • Server
  • Console
  • CLI
  • Docs
  • Community Content
  • Build System

Requires changes from other components? If yes, please mark the components:

  • Server
  • Console
  • CLI
  • Docs
  • Community Content
  • Build System

Related Issue

#547

Solution and Design

Listen on specified columns but send entire record as payload.

Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Docs update
  • Community content

Checklist:

  • I have read the contributing guide and my code conforms to the guidelines.
  • This change requires a change in the documentation.
  • I have updated the documentation accordingly.
  • I have added required tests.

@tirumaraiselvan
Copy link
Contributor Author

@karthikvt26 There are console changes required in the advanced settings of event triggers creation page.

@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-550.herokuapp.com

@tirumaraiselvan
Copy link
Contributor Author

tirumaraiselvan commented Sep 27, 2018

TODO: Dependency changes

@shahidhk shahidhk added the c/server Related to server label Sep 27, 2018
@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-550.herokuapp.com

@shahidhk shahidhk added the s/do-not-merge Do not merge this pull request to master label Sep 27, 2018
@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-550.herokuapp.com

@tirumaraiselvan tirumaraiselvan removed the s/do-not-merge Do not merge this pull request to master label Oct 5, 2018
@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-550.herokuapp.com

@shahidhk
Copy link
Member

shahidhk commented Oct 5, 2018

@tirumaraiselvan What is the new API?

@tirumaraiselvan
Copy link
Contributor Author

tirumaraiselvan commented Oct 5, 2018

Same as before with an optional payload key in insert,update and delete spec:

{
  "type": "create_event_trigger",
  "args": {
    "name": "testtriggerheaders",
    "table": "users",
    "update": {
      "columns": ["username", "real_name"],
      "payload": "*"
    },
    "insert": {
        "columns": "*",
        "payload": ["username"]
    },
   "delete": {
        "columns": "*"
    },
    "webhook": "https://httpbin.org/post",
    "headers":[
      {
        "name": "X-Hasura-From-Val",
        "value": "myvalueNEW"
      },
      {
        "name": "X-Hasura-From-Env",
        "value_from_env": "EVENT_WEBHOOK_HEADER"
      }
    ]
  }
}

@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-550.herokuapp.com

1 similar comment
@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-550.herokuapp.com

@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-550.herokuapp.com

1 similar comment
@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-550.herokuapp.com

@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-550.herokuapp.com

@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-550.herokuapp.com

@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-550.herokuapp.com

@0x777 0x777 self-requested a review October 22, 2018 06:27
@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-550.herokuapp.com

0x777
0x777 previously approved these changes Oct 23, 2018
@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-550.herokuapp.com

@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-550.herokuapp.com

getColInfos cols allCols
fromMaybePayload :: Maybe SubscribeColumns -> SubscribeColumns
fromMaybePayload (Just sc) = sc
fromMaybePayload Nothing = SubCStar
Copy link
Member

Choose a reason for hiding this comment

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

use fromMaybe from Data.Maybe.

@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-550.herokuapp.com

@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-550.herokuapp.com

@shahidhk shahidhk changed the title Listen to column expressions instead of whole row (close #547, close #680) trigger webhooks on column level changes instead of whole row (close #547, close #680) Oct 25, 2018
@shahidhk shahidhk changed the title trigger webhooks on column level changes instead of whole row (close #547, close #680) trigger webhooks on column level changes instead of row (close #547, close #680) Oct 25, 2018
@shahidhk shahidhk merged commit 810b440 into hasura:master Oct 25, 2018
@hasura-bot
Copy link
Contributor

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

rikinsk-zz pushed a commit to rikinsk-zz/graphql-engine that referenced this pull request Oct 25, 2018
@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 147927e
Status:⚡️  Build in progress...

View logs

hasura-bot pushed a commit that referenced this pull request May 10, 2024
V3_GIT_ORIGIN_REV_ID: cc078462ec7713139875b0991e86f670d81b7ae6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c/server Related to server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants