Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple CLI to wrap the graphql api #40

Closed
wants to merge 2 commits into from
Closed

Simple CLI to wrap the graphql api #40

wants to merge 2 commits into from

Conversation

korthout
Copy link

Description

adds a golang-based command line interface that may wrap the
graphql api. Only a very basic cli is added, offering only help, version
and workflows commands, but other commands can be easily added.

The source for zbctl is the origin of this source code. I've stripped
its commands, altered some wording and that's it.

Proposal

This PR is a proposal and offers the core of a golang-based CLI. It is in
no way a comprehensive interface at this time. We should discuss
whether this solution fits with the graphql concepts.

For example, we should discuss the maintenance cost of adding new
graphql types and fields considering they would now also require
manual implementation in this cli.

Example usage:

zeeqs help

zeeqs is command line interface designed to query the Zeebe Query
Service for aggregated Zeebe data.

Usage:
  zeeqs [command]

Available Commands:
  help      Help about any command
  version   Print the version of zeeqs
  workflows Query deployed workflows

Flags:
  -h, --help   help for zeeqs

Use "zeeqs [command] --help" for more information about a command.

zeeqs version

zeeqs development (commit: 77254c26)

zeeqs workflows

{"data":{"workflows":{"nodes":[{"key":"2251799813685249"}]}}}

This commit adds a golang-based command line interface that may wrap the
graphql api. Only a very basic cli is added, offering only help and
version commands, but other commands can be easily added.

The source for zbctl is the origin of this source code. I've stripped
its commands, altered some wording and that's it.

Example usage:

```
zeeqs help
```

zeeqs is command line interface designed to query the Zeebe Query
Service for aggregated Zeebe data.

Usage:
  zeeqs [command]

Available Commands:
  help        Help about any command
  version     Print the version of zeeqs

Flags:
  -h, --help   help for zeeqs

Use "zeeqs [command] --help" for more information about a command.
This commit adds a PoC to actually query the graphql api by adding a
workflows command.

It simply executes the equivalent of:

```
curl \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{ "query": "{ workflows { nodes { key } } }" }' \
  http://localhost:9000/graphql
```
@saig0
Copy link
Contributor

saig0 commented Jul 13, 2020

Great idea 👍

@CLAassistant
Copy link

CLAassistant commented Mar 18, 2022

CLA assistant check
All committers have signed the CLA.

@saig0 saig0 marked this pull request as ready for review March 30, 2022 12:33
@saig0
Copy link
Contributor

saig0 commented Mar 30, 2022

Oops, I clicked the wrong button 😅

@korthout are you still interested in developing the CLI?
Otherwise, we could close (i.e. archive) your PR for now.
In any case, I really appreciate your initiative 🚀

@korthout
Copy link
Author

Currently, I don't intend to continue working on it. Perhaps in the future this becomes more interesting again. We can archive (close) it for now.

@korthout korthout closed this Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants