hasura graphql server event trigger 试用
hasura graphql server 是一个很不错的graphql 引擎,当前版本已经支持event triiger 了
使用此功能我们可以方便的集成webhook功能,实现灵活,稳定,快捷的消息驱动的应用
webhook 使用benthos ,简单例子参考 https://www.cnblogs.com/rongfengliang/p/9569811.html
一张参考图

环境搭建
使用docker-compose
- docker-compose 文件
version: '3.6'
services:
postgres:
image: postgres
ports:
- "5432:5432"
environment:
- "POSTGRES_PASSWORD:dalong"
volumes:
- ./db_data:/var/lib/postgresql/data
benthos:
image: jeffail/benthos
volumes:
- "./configs/webhook.yaml:/benthos.yaml"
ports:
- "4195:4195"
graphql-engine:
image: hasura/graphql-engine:v1.0.0-alpha16
ports:
- "8080:8080"
depends_on:
- "postgres"
environment:
- "POSTGRES_PASSWORD:dalong"
command: >
/bin/sh -c "
graphql-engine --database-url postgres://postgres:dalong@postgres:5432/postgres serve --enable-console;
"
- benthos webhook 配置
webhook.yaml 文件
input:
type: broker
broker:
inputs:
- type: http_server
http_server:
path: /post/customer1
processors:
- type: text
text:
operator: prepend
value: "Customer 1 received: "
- type: http_server
http_server:
path: /post/customer2
processors:
- type: text
text:
operator: prepend
value: "Customer 2 received: "
- type: http_server
http_server:
path: /post/customer3
processors:
- type: text
text:
operator: prepend
value: "Customer 3 received: "
output:
type: stdout
启动&&运行
- 启动graphql server&& benthos stream webhook
docker-compose up -d
- 效果

测试event trigger
- 添加基本数据

- 添加evnet triiger
具体webhook 地址参考自己电脑ip,我使用docker-compose 的service

- 添加数据测试

说明
类似的支持框架有prisma 都是挺不错的,但是hasura graphql 看起来潜力是无限的,只是在crud 这方便如果能扩展到不止pg 就更好了。
参考资料
https://www.cnblogs.com/rongfengliang/p/9569811.html
https://hasura.io/
https://github.com/Jeffail/benthos/tree/master/resources/docker/streams
https://github.com/rongfengliang/hasura-graphql-event-benthos
hasura graphql server event trigger 试用的更多相关文章
- hasura graphql server 集成gatsby
hasura graphql server 社区基于gatsby-source-graphql 开发了gatsby-postgres-graphql 插件, 可以快速的开发丰富的网站 基本使用 安装h ...
- hasura graphql server 集成gitlab
默认官方是提供了gitlab 集成的demo的,但是因为gitlab 一些版本的问题, 跑起来总有问题,所以查找相关资料测试了一个可以运行的版本 项目使用docker-compose 运行 参考 ht ...
- hasura graphql server (haskell)构建
安装 &&运行pg(docker) version: '3.6' services: postgres: image: postgres environment: - "PO ...
- gqlgen golang graphql server 基本试用
gqlgen golang 的graphql server 具体代码参考https://github.com/rongfengliang/gqlgen-demo 特点 模型优先 类型安全 代码生成 安 ...
- hasura graphql subscriptions 使用
subscriptions graphql 的一项实时数据推送的功能,还是很方便的,自己在直接使用subscriptions-transport-ws npm 包 的时候运行一直有错误(主要是依赖 ...
- SAP CRM 使用Javascript触发SAP Server Event
原文地址:How To Trigger SAP Server Event With Javascript 本文地址:http://www.cnblogs.com/hhelibeb/p/5977921. ...
- hasura graphql auth-webhook api 说明
hasura graphql 生产的使用是推荐使用webhook 进行角色访问控制的,官方同时提供了一个nodejs 的简单demo 代码 git clone https://github.com/h ...
- hasura graphql pg 自定义函数的使用
hasura graphql 的安装可以参考相关项目 创建函数 数据表创建 CREATE TABLE sql_function_table ( id SERIAL PRIMARY KEY, inp ...
- 第二十五课:jQuery.event.trigger的源码解读
本课主要来讲解jQuery.event.trigger的源码解读. trigger = function(event, data, elem, onlyHandlers){ if(elem & ...
随机推荐
- Confluence 6 使用 LDAP 授权连接一个内部目录 - 成员 Schema 设置
请注意:这部分仅在拷贝用户登录(Copy User on Login)和 同步组成员(Synchronize Group Memberships)被启用后可见. 用户组成员属性(Group Membe ...
- Charles安装破解、抓取https请求及常见问题解决方法
现在基本大部分网站都使用了https,所以要想抓到https的请求,首要任务是先有工具:charles.fiddler,先介绍下charles针对https请求的抓取方法,此方法兼容windows和m ...
- jquery添加类
一.addClass() 方法向被选元素添加一个或多个类. 1.对P元素添加一个intro类.<!DOCTYPE html><html><head lang=" ...
- VS2013/2015 html 设计视图窗口
- HDOJ1005
#include "iostream" using namespace std; int fun(int A,int B,int n) { ,y = ,z; || n == ) ; ...
- 应用多种变形CSS3
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> < ...
- linux physical and virtual addressing modes
example 1: 特理地址和虚拟地址一致 Physical addressing mode requires no page tables and the CPU does not attempt ...
- c++多态多实例
#include <bits/stdc++.h> using namespace std; class A { public: A() { cout << "构造A& ...
- delphi image控件上画矩形的问题
画的时候发现鼠标点的位置和矩形的位置有偏移 后来查看发现是由于image控件时stretch属性设置为true,这样在画的时候是缩放了的 也就是画到image显示的图片上去了 所以如果要画矩形,要按照 ...
- pyqt(一)安装及配置。
一:简介 PyQt实现了一个Python模块集.它有超过300类,将近6000个函数和方法.它是一个多平台的工具包,可以运行在所有主要操作系统上,包括UNIX,Windows和Mac. PyQt采用双 ...