graphql-engine/cli
Antoine Leblanc e2ce1972f6 Prevent empty subscription roots (fix hasura/graphql-engine#6898)
### Description

We always build a subscription root, even when there was no possible fields. This breaks some third party clients, as the spec does not allow empty types in the schema. This PR fixes this by changing the `buildSubscriptionParser` helper to return a `Maybe` value, and harmonizes / cleans places where we build the subscription root.

https://github.com/hasura/graphql-engine-mono/pull/2357

GitOrigin-RevId: 1aeae25e321eee957e7645c436d17e69207309fd
2021-09-16 07:42:46 +00:00
..
build ci: add tests for cli-migrations image (#4396) 2020-04-15 07:26:00 +05:30
cmd/hasura cli: update go.mod 2021-06-16 11:45:07 +00:00
commands cli: make progress bar render properly on all emulators and add progress bar-logs flag to get logs on CI 2021-09-14 14:28:52 +00:00
integration_test cli: fix data-race warnings 2021-09-07 13:34:54 +00:00
internal Prevent empty subscription roots (fix hasura/graphql-engine#6898) 2021-09-16 07:42:46 +00:00
migrate cli: make progress bar render properly on all emulators and add progress bar-logs flag to get logs on CI 2021-09-14 14:28:52 +00:00
pkg cli: fix data-race warnings 2021-09-07 13:34:54 +00:00
plugins cli: update go.mod 2021-06-16 11:45:07 +00:00
seed cli: add support for citus sources 2021-06-21 14:35:00 +00:00
telemetry cli: send error to telemetry 2021-09-08 08:56:54 +00:00
update cli: update promptui dependency (#51) 2020-11-18 13:36:24 +00:00
util cli: fix data-race warnings 2021-09-07 13:34:54 +00:00
version cli: fix cli compatibility check message 2021-05-19 09:32:33 +00:00
.gitignore cli: show only differences in metadata on metadata diff 2021-06-17 10:16:17 +00:00
.realize.yaml cli: update go-binddata, fix realize (close #3588) (#3687) 2020-01-13 15:24:41 +05:30
cli.go cli: fix query endpoint construction 2021-08-09 08:41:16 +00:00
CONTRIBUTING.md cli: fix inconsistent metadata object list rendering 2021-07-16 05:26:47 +00:00
directory.go cli: use absolute path of project directory 2021-07-16 12:59:04 +00:00
get.sh tag release v2.0.7 (#2118) 2021-08-17 13:07:37 +00:00
global_config.go Fix typo in debug logs 2021-05-11 06:49:28 +00:00
go.mod cli: fix data-race warnings 2021-09-07 13:34:54 +00:00
go.sum cli: fix data-race warnings 2021-09-07 13:34:54 +00:00
logger_hook.go cli: add migrate and metadata packages 2021-06-18 06:25:14 +00:00
Makefile cli: embed cli-ext as exe in case of windows 2021-09-07 06:01:00 +00:00
README.md tag release v2.0.9 2021-09-07 07:49:53 +00:00

Hasura GraphQL Engine CLI

GoDoc

Installation

Download GraphQL Engine CLI bundled with Hasura CLI

  • Linux/macOS

    curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash
    

    This will install the Hasura CLI in /usr/local/bin. You might have to provide your sudo password depending on the permissions of your /usr/local/bin location.

    If youd prefer to install to a different location other than /usr/local/bin, set the INSTALL_PATH variable accordingly:

    curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | INSTALL_PATH=$HOME/bin bash
    

    You can also install a specific version of the CLI by providing the VERSION variable:

    curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | VERSION=v2.0.9 bash
    
  • Windows

    Download the binary cli-hasura-windows-amd64.exe available under Assets of the latest release from the GitHub release page: https://github.com/hasura/graphql-engine/releases

Download using go get

go get github.com/hasura/graphql-engine/cli/cmd/hasura

Build from source

git clone https://github.com/hasura/graphql-engine
cd graphql-engine/cli
make deps
make build
# binaries will be in _output directory

Usage

hasura init --directory <my-project> --endpoint <graphql-endpoint> --admin-secret <admin-secret>
cd <my-project>
hasura console

Contributing

Checkout the contributing guide.