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 & ...
随机推荐
- 3.5 MIPS体系结构
计算机组成 3 指令系统体系结构 3.5 MIPS体系结构 MIPS是精简指令系统的代表,采用了与X86相反的设计理念,并引领了精简指令系统的潮流,那就让我们一起来看一看这究竟是怎么一回事. 要探讨M ...
- AndroidStudio使用偷懒插件Butterknife和GsonFormat
1.Android ButterKnife Zelezny Android Studio上安装插件,如图: 配合ButterKnife实现注解,从此不用写findViewById,想着就爽啊.在Act ...
- Mysql查询用逗号分隔的字段-字符串函数FIND_IN_SET(),以及此函数与in()函数的区别
查询用逗号分隔的字段,可以用字符串函数FIND_IN_SET(): 查询数据库表中某个字段(值分行显示),可以用函数in(). 今天工作中遇到一个问题,就是用FIND_IN_SET()函数解决的. 第 ...
- UVA-10995 Educational Journey
The University of Calgary team qualified for the 28th ACM International Collegiate Programming Conte ...
- linux shard virtual memory
- IScroll的诞生和缺点
转自http://lhdst-163-com.iteye.com/blog/1239784 iscroll.js是Matteo Spinelli开发的一个js文件,使用原生js编写,不依赖与任何js框 ...
- bzoj2662
题解: spfa最短路径 dp[i][j]表示到i,用了j掌权 然后转移 代码: #include<bits/stdc++.h> using namespace std; ; int n, ...
- 模拟QQ分组(具有伸缩功能) (添加开源框架的光闪烁效果)SimpleExpandableListAdapter 适配器的用法,并且可添加组及其组内数据。
package com.lixu.qqfenzu; import java.util.ArrayList; import java.util.HashMap; import java.util.Lis ...
- Delphi中的文件扩展名
Filename Extensions in Delphi http://delphi.about.com/od/beginners/a/aa032800a.htm Try building a sm ...
- The "Double-Checked Locking is Broken" Declaration
双重检查锁定在延迟初始化的单例模式中见得比较多(单例模式实现方式很多,这里为说明双重检查锁定问题,只选取这一种方式),先来看一个版本: public class Singleton { private ...