New Features of hasura graphql-engine v1.0.0-alpha26 trial

Source: Internet
Author: User
Tags table definition
 

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

  • Docker-Compose File
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 } }
  • Start
docker-compose up -d

  • Test data table
-- 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
  • Order_by Query
query {   citus_userlogin(order_by:{id:asc}) {    id    username    userage  }}
  • Aggregate parameter operations
query {   citus_userlogin_aggregate {     aggregate {       max {        userage      }    }  }}


  • Event trigger
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.