Hasura graphql-engine v1.0.0-alpha26 has been released, and there are many new changes. The docker environment is tested and the PostgreSQL database uses citus.
Citus is a convenient PostgreSQL database extension solution.
Environment preparation
Docker-Compose & citus
version: ‘2.1‘services: graphql-engine: image: hasura/graphql-engine:v1.0.0-alpha26 ports: - "8080:8080" command: > /bin/sh -c " graphql-engine --database-url postgres://[email protected]/postgres serve --enable-console; " master: container_name: "${COMPOSE_PROJECT_NAME:-citus}_master" image: ‘citusdata/citus:7.5.1‘ ports: ["${MASTER_EXTERNAL_PORT:-5432}:5432"] labels: [‘com.citusdata.role=Master‘] worker: image: ‘citusdata/citus:7.5.1‘ labels: [‘com.citusdata.role=Worker‘] depends_on: { manager: { condition: service_healthy } } manager: container_name: "${COMPOSE_PROJECT_NAME:-citus}_manager" image: ‘citusdata/membership-manager:0.2.0‘ volumes: [‘/var/run/docker.sock:/var/run/docker.sock‘] depends_on: { master: { condition: service_healthy } }
docker-compose up -d
-- DDL generated by Postico 1.4.2-- Not all database features are supported. Do not use for backup.-- Table Definition ----------------------------------------------CREATE TABLE citus.userlogin ( id integer DEFAULT nextval(‘citus.userlogin_id_seq‘::regclass) PRIMARY KEY, username text NOT NULL, userage integer NOT NULL);-- Indices -------------------------------------------------------CREATE UNIQUE INDEX userlogin_pkey ON citus.userlogin(id int4_ops);
Test new functions
query { citus_userlogin(order_by:{id:asc}) { id username userage }}
- Aggregate parameter operations
query { citus_userlogin_aggregate { aggregate { max { userage } } }}
Description
Hasura graphql-engine is becoming more and more convenient. The hasura team is very powerful and it is too convenient for development.
References
Https://docs.hasura.io/1.0/graphql/manual/getting-started/index.html
Https://github.com/hasura/graphql-engine/releases
Https://www.citusdata.com/
New Features of hasura graphql-engine v1.0.0-alpha26 trial