You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hasura events can have more than one trigger for a schema/table/op. It would be better if the decorator accepts the trigger.name as an option, so we don't need to care about schema/table/op.
We can also create an event trigger to listen different column with the same schema/table/op
Example
@Injectable()
class UsersService {
@HasuraEventHandler({
trigger: {
name: 'user_field_A_changed' // op "UPDATE"
}
})
handleUserFieldAChanged(evt: HasuraEvent) {
// send an email ....
}
@HasuraEventHandler({
trigger:{
name: 'user_field_B_changed' // op "UPDATE"
}
})
handleUserFieldBChanged(evt: HasuraEvent) {
// trigger to 3rd party
}
@HasuraEventHandler({
trigger:{
name: 'user_has_been_created' // op "INSERT"
}
})
handleUserCreated(evt: HasuraEvent) {
// send a welcome email ....
}
}
Hey @n3n Thanks for opening this issue, I think this is great feedback and it definitely makes sense that targeting the trigger name would give the user a lot more flexibility for properly subscribing to events.
I'll do my best to spend some time improving this feature this week
Hey @n3n this feature as well as the fix that you submitted in #153 have been released and are now available in version 0.4.0. The docs have been updated to reflect this change as well as I plan to deprecate the schema/table approach in favor of the trigger name and remove it in a future release
Hasura events can have more than one trigger for a schema/table/op. It would be better if the decorator accepts the
trigger.name
as an option, so we don't need to care about schema/table/op.We can also create an event trigger to listen different column with the same schema/table/op
Example
Reference: https://hasura.io/docs/1.0/graphql/manual/event-triggers/payload.html#json-payload
The text was updated successfully, but these errors were encountered: