hasura graphql schema 导出】的更多相关文章

使用的是apollo 的插件 安装apollo npm install -g apollo 基本使用 因为我使用了模式拼接,所以地址有变动,一般是 http://host:port/v1alpha1/graphql 格式 apollo schema:download --endpoint=http://localhost:8080/graphql 生成的格式 参考资料 https://docs.hasura.io/1.0/graphql/manual/schema/export-graphql-…
不像大部分的graphql 引擎,使用标准的graphql 规范的处理模型,Hasura graphql 不存在resolver 的概念(实际上是有的,只是转换为了sql语法) 以下是Hasura graphql 引擎的内幕 表的处理 假设有一张表 profile(id,name) 需要暴露为graphql api ,以下是Hasura 的处理方式 根据表生成一个graphql 类型(type) 根据表生成聚合函数的graphql 类型 同时还会生成关系聚合函数的数据类型 生成查询参数 wher…
  hasura graphql 的安装可以参考相关项目 创建函数 数据表创建 CREATE TABLE sql_function_table ( id SERIAL PRIMARY KEY, input text NOT NULL, output text ); 创建函数以及触发器 CREATE FUNCTION test_func() RETURNS trigger AS $emp_stamp$ BEGIN NEW.output := UPPER(NEW.input); RETURN NEW…
Writing out a GraphQL Schema in the common GraphQL Language can work for simple GraphQL Schemas, but as our application grows, or when we start using more complex types like interfaces or unions, we find that we can’t use a GraphQL Language file in t…
If we have a GraphQL Schema expressed in terms of JavaScript, then we have a convenient package available to us that let’s us easily serve up our schema on any endpoint in an Express Server. In this video, we’ll use the express-graphql package to ser…
we’ll take a look at the GraphQL Language and write out our first GraphQL Schema. We’ll use the graphql package available to us through npm to parse our graphql language file and resolve our initial query. const { graphql, buildSchema } = require('gr…
torodb 可以方便的将mongo 数据实时同步到pg,hasura graphql 可以方便的将pg 数据暴露为graphql api,集成在一起真的很方便 环境准备 docker-compose 文件 version: '2' services: graphql-engine: image: hasura/graphql-engine:v1.0.0-alpha27 ports: - "8080:8080" command: > /bin/sh -c " graph…
hasura graphql server 社区基于gatsby-source-graphql 开发了gatsby-postgres-graphql 插件, 可以快速的开发丰富的网站 基本使用 安装hasura graphql server 我使用的Heroku 已经部署好了 https://rongfengliang.herokuapp.com/ 说明:后边可能会删了,测试的话,最好的自己搭建 添加表结构以及数据(hasura server) gastby 集成测试 package.json…
hasura graphql server 是一个很不错的graphql 引擎,当前版本已经支持event triiger 了 使用此功能我们可以方便的集成webhook功能,实现灵活,稳定,快捷的消息驱动的应用 webhook 使用benthos ,简单例子参考 https://www.cnblogs.com/rongfengliang/p/9569811.html 一张参考图 环境搭建 使用docker-compose docker-compose 文件 version: '3.6' ser…
转自官方文档 In the last article, we discussed the ins and outs of remote (executable) schemas. These remote schemas are the foundation for a set of tools and techniques referred to as schema stitching. Schema stitching is a brand new topic in the GraphQL…
  subscriptions graphql 的一项实时数据推送的功能,还是很方便的,自己在直接使用subscriptions-transport-ws npm 包 的时候运行一直有错误(主要是依赖的apollo版本),还好hasura graphql 默认提供了一个开发模版,还是比较方便的 模版clone git clone https://github.com/hasura/nodejs-graphql-subscriptions-boilerplate.git 基本代码集成 使用模版(g…
hasura graphql 生产的使用是推荐使用webhook 进行角色访问控制的,官方同时提供了一个nodejs 的简单demo 代码 git clone https://github.com/hasura/sample-auth-webhook 代码说明 项目结构 api 格式说明 auth0 auth0/auth0Handler.js var express = require('express'); var auth0Router = express.Router(); var req…
-------------------root.graphqls---------------------------这个文件用来定义属性字段,必须和实体类相同 文件里面的字段写错会报这个错误 com.coxautodev.graphql.tools.FieldResolverError: No method or field found with any of the following signatures (with or without one of [interface graphql…
As we start building out more complex GraphQL schemas, certain fields start to repeat across different types. This is a perfect use-case for the Interface Type made available to us through GraphQL’s Type System. In this video, we’ll go over how to cr…
graphql-compose 是一个强大的graphql schema 生成工具集 包含以下特性 快速便捷的复杂类型生成 类型仓库,类型可以存储在schemacomposer 存储中 包含flowtype(不太还用),typescript 的类型定义 方便的插件 包含json 以及date 类型 快速的从graphql-tools 迁移 当前支持的插件 mongose elasticsearch aws sdk 参考资料 https://graphql-compose.github.io/ h…
Hasura 使用pg 数据库存储引擎的元数据信息,在hdb_catalog schema 下面,是在初始化的时候生成的 对于表的管理.权限的信息存储都在这个schema下 hdb_table 这个表包含了所有通过web界面或者cli工具管理的表以及视图 列的定义 table_schema: 表或者视图的schmema table_name: 表或者视图的名称 is_system_defined: 标示是否是系统表 参考例子 hdb_relationship 定义表的约束以及手工添加的关系 列的…
具体的使用可以参考下面一张图 有一个术语 graphql-bindings 参考项目: https://github.com/hasura/generate-graphql-bindings https://github.com/graphql-binding/graphql-binding 使用的场景 需要从多个数据源进行数据获取 需要自定义的数据操作(数据校验) api gateway (参考上图) 参考资料 https://www.prisma.io/blog/reusing-and-co…
默认官方是提供了gitlab 集成的demo的,但是因为gitlab 一些版本的问题, 跑起来总有问题,所以查找相关资料测试了一个可以运行的版本 项目使用docker-compose 运行 参考 https://github.com/Trantect/docker-compose.yamls 环境准备 docker-compose 文件 version: '2' services: redis: image: sameersbn/redis:4.0.9-1 command: - --loglev…
实际上因为pipelinedb 是原生支持pg的,所以应该不存在太大的问题,以下为测试 使用doker-compose 运行 配置 docker-compose 文件 version: '3.6' services: postgres: image: tkanos/pipelinedb_kafka ports: - "5432:5432" graphql-engine: image: hasura/graphql-engine:v1.0.0-alpha06 ports: - "…
模块 npm install -g get-graphql-schema get-graphql-schema GRAPHQL_URL > schema.graphql 简单使用 使用prisma cli prisma init appdemo cd appdmeo docker-compose up -d prisma deploy 使用 get-graphql-schema http://localhost:4466 > schema.graphql 用途 我们在进行graphql-bin…
目前从官方文档以及测试可以看出不加任何header的请求访问的是所有的数据,对于具有访问 控制的请求需要添加请求头,实际生产的使用需要集合web hook 的实现访问控制. 参考配置 访问请求 目前数据只有id=1 不匹配的 匹配的 没有添加角色的(获取所有数据) 几张官方的参考图 配置 开发环境测试 生产使用 参考资料 https://docs.hasura.io/1.0/graphql/manual/auth/index.html        …
实际上通过上边的介绍,模式拼接和hasura 基本没啥关系了,就是使用graphql-bindings 进行schema 合并了 基本demo 这个是官方提供的demo git clone https://github.com/hasura/graphql-schema-stitching-demo 运行 依赖安装 yarn 运行 HASURA_GRAPHQL_ENGINE_URL=http://localhost:9090 yarn start 效果 使用到的技术 mergeSchemas m…
hasura 使用一个基于pg数据库的graphql引擎,他的设计比postgrpahql 有好多方便的地方,同时使用也比较简单 安装 docker && docker-compose curl -L https://cli.hasura.io/install.sh | bash hasura init --directory my-project cd my-project/install-scripts docker-compose up -d 生成结果 ├── config.yaml…
merge-graphql-schemas 是一个方便的工具,可以进行schema 以及resovler 的合并处理 一个schema 合并参考demo schema 定义 // ./graphql/types/clientType.js export default ` type Client { id: ID! name: String age: Int products: [Product] } ​ type Query { clients: [Client] client(id: ID!…
graphql-inspector 是一个方便的graphql 周边工具,可以加速graphql 应该的开发,同时可以帮助我们排查问题 包含以下特性: 进行schema 的比较 文档校验(通过schema) 相似以及重复类型查找 查找破坏性或者危险的变动 查看基于文档的schema 覆盖率 mock 服务 github bot github actions 说明 我们同时也可以将graphql-inspector 做为一个library 使用,方便集成到我们的系统中,是一个很不错的工具 参考资料…
安装 &&运行pg(docker) version: '3.6' services: postgres: image: postgres environment: - "POSTGRES_PASSWORD:dalong" restart: always ports: - "5432:5432" volumes: - db_data:/var/lib/postgresql/data volumes: db_data: 安装satck haskell 构…
参考资料 https://github.com/sogko/graphql-schema-language-cheat-sheet        …
新的hasura graphql-engine 代码仓库中已经包含了一个基于express 的简单graphql server, 可以用来测试模式拼接 graphql server 代码 项目结构 ├── Dockerfile ├── README.md ├── now.json ├── package.json └── server.js 代码说明 package.json: 依赖包 { "name": "nodejs-express-gql-server", &…
数据泵是10g推出的功能,个人倒数据比较喜欢用数据泵. 其导入的时候利用remap参数很方便转换表空间以及schema,并且可以忽略服务端与客户端字符集问题(exp/imp需要排查字符集). 数据泵也有不方便的地方,如果远程导出导入,必须安装数据库服务端(client不行):需要在数据库中创建一个路径directory(dba_directories):并且主流工具支持exp/imp的导入导出(plsql developer),所以发现数据泵流行程度没有想象中高. 以下简单介绍schema的导入…
https://github.com/dbohdan/automatic-api 是一个不错的github 知识项目,帮助我们 列出了,常见的的数据库可以直接转换为rest/graphql api 的开源项目 Project name/link Database(s) supported API type Implementation language License GitHub stats Notes ArangoDB ArangoDB REST C++ Apache 2.0 6645 ★;…