Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michaelcurrin/github-gql-go
An easy way to query GitHub's GraphQL API from the command-line
https://github.com/michaelcurrin/github-gql-go
github-api github-api-v4 github-graphql go gql gql-api graphql
Last synced: 1 day ago
JSON representation
An easy way to query GitHub's GraphQL API from the command-line
- Host: GitHub
- URL: https://github.com/michaelcurrin/github-gql-go
- Owner: MichaelCurrin
- License: mit
- Created: 2021-02-14T14:09:46.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-24T19:43:48.000Z (6 months ago)
- Last Synced: 2024-10-12T19:36:38.812Z (about 1 month ago)
- Topics: github-api, github-api-v4, github-graphql, go, gql, gql-api, graphql
- Language: Go
- Homepage:
- Size: 141 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GitHub GraphQL Go
> An easy way to query GitHub's GraphQL API from the command-line[![Go CI](https://github.com/MichaelCurrin/github-gql-go/workflows/Go%20CI/badge.svg)](https://github.com/MichaelCurrin/github-gql-go/actions?query=workflow:"Go+CI")
[![GitHub tag](https://img.shields.io/github/tag/MichaelCurrin/github-gql-go?include_prereleases=&sort=semver)](https://github.com/MichaelCurrin/github-gql-go/releases/)
[![License](https://img.shields.io/badge/License-MIT-blue)](#license)[![Made with Go](https://img.shields.io/github/go-mod/go-version/MichaelCurrin/github-gql-go?logo=go&logoColor=white)](https://golang.org)
[![dependency - githubv4](https://img.shields.io/badge/dependency-githubv4-blue)](https://pkg.go.dev/github.com/shurcooL/githubv4)A CLI tool to query the [GitHub GraphQL](https://michaelcurrin.github.io/dev-resources/resources/version-control/github/graphql.html) API by acting as a wrapper on another Go package.
## Sample usage
Create your GH auth token and set it on the environment.
```sh
$ export GH_TOKEN=abcdef
```Run the CLI app to do a query and print results.
```console
$ ghgql
Login: MichaelCurrin
Created at: 2016-04-30 11:19:17 +0000 UTC
Avatar URL: https://avatars.githubusercontent.com/u/18750745?s=72&u=ec21949f76c6d8f152f3d8c8f8204d86d6fceba5&v=4
```## Purpose
The intention for this project is:
- Be easy to use for developers who are not familiar with Go.
- Produce an binary executable for downloading (without needing Node or Python installed).
- Allow use interactively in the CLI or in project pipeline to handle (such as to download GitHub data as JSON data and use it to make a site).## Limitations ⚠️
- This project only uses fixed GQL queries. There is a request for the current user and a request for this repo. The results get printed as text.
- Aims for future development:
- Use a selection of `.gql` input file given by the user, or choose from queries known to the app. Currently using a Go object, which might be more practical anyway for types.
- Save output as a JSON or CSV file.
- For a more full-fledged project that has a variety GQL files and writes CSV reports for each one, see my [GH Reporting Tool](https://github.com/MichaelCurrin/github-reporting-py) in Python.## Documentation
> How to install and run this project locally and release it[![Documentation](https://img.shields.io/badge/View-Documentation-blue?style=for-the-badge)](/docs/)
## License
Released under [MIT](/LICENSE) by [@MichaelCurrin](https://github.com/MichaelCurrin).