hasura graphql server (haskell)构建

时间:2023-03-09 19:04:23
hasura  graphql   server (haskell)构建

安装 &&运行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 构建工具

curl -sSL https://get.haskellstack.org/ | sh

构建

构建有点慢

cd graphql-engine/server
stack build --fast

运行

  • 启动pg
docker-compose up -d
  • 运行
stack exec graphql-engine -- --database-url=postgres://postgres:dalong@localhost:5432/postgres serve --enable-console
  • 效果
    hasura  graphql   server (haskell)构建
    hasura  graphql   server (haskell)构建
    hasura  graphql   server (haskell)构建
    hasura  graphql   server (haskell)构建

参考资料

https://github.com/hasura/graphql-engine/blob/master/server/CONTRIBUTING.md