{"id":16551236,"url":"https://github.com/michaelcurrin/github-gql-js","last_synced_at":"2025-03-04T15:41:17.855Z","repository":{"id":93178409,"uuid":"421077398","full_name":"MichaelCurrin/github-gql-js","owner":"MichaelCurrin","description":"Starter template for querying GitHub's GQL API using Node","archived":false,"fork":false,"pushed_at":"2022-05-11T12:42:25.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-14T20:52:46.785Z","etag":null,"topics":["github-graphql","github-v4","gql","javascript","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MichaelCurrin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-25T15:20:26.000Z","updated_at":"2021-10-26T09:07:39.000Z","dependencies_parsed_at":"2023-04-11T11:01:17.389Z","dependency_job_id":null,"html_url":"https://github.com/MichaelCurrin/github-gql-js","commit_stats":null,"previous_names":[],"tags_count":2,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelCurrin%2Fgithub-gql-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelCurrin%2Fgithub-gql-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelCurrin%2Fgithub-gql-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaelCurrin%2Fgithub-gql-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MichaelCurrin","download_url":"https://codeload.github.com/MichaelCurrin/github-gql-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241876002,"owners_count":20035368,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-graphql","github-v4","gql","javascript","nodejs"],"created_at":"2024-10-11T19:36:43.118Z","updated_at":"2025-03-04T15:41:17.849Z","avatar_url":"https://github.com/MichaelCurrin.png","language":"JavaScript","readme":"# GitHub GraphQL JS\n\u003e Starter template for querying GitHub's GQL API using Node\n\n[![GitHub tag](https://img.shields.io/github/tag/MichaelCurrin/github-gql-js?include_prereleases=\u0026sort=semver\u0026color=blue)](https://github.com/MichaelCurrin/github-gql-js/releases/)\n[![License](https://img.shields.io/badge/License-MIT-blue)](#license)\n\n[![Made with Node.js](https://img.shields.io/badge/Node.js-\u003e=12-blue?logo=node.js\u0026logoColor=white)](https://nodejs.org)\n[![Package - @octokit/graphql](https://img.shields.io/github/package-json/dependency-version/MichaelCurrin/github-gql-js/@octokit/graphql?color=blue)](https://www.npmjs.com/package/@octokit/graphql)\n\n\n\u003cdiv align=\"center\"\u003e\n\n[![Use this template](https://img.shields.io/badge/Generate-Use_this_template-2ea44f?style=for-the-badge)](https://github.com/MichaelCurrin/github-gql-js/generate)\n\n\u003c/div\u003e\n\n\n## About\n\nThis repo demonstrates how to query GitHub's GraphQL API using Node.\n\nThe `graphql` NPM package is used. The content is based on the documentation here:\n\n- [octokit/graphql.js](https://github.com/octokit/graphql.js)\n    \u003e GitHub GraphQL API client for browsers and Node\n\n\n## Installation\n\n### Clone\n\nClone this repo.\n\n```sh\n$ git clone git@github.com:MichaelCurrin/github-gql-js.git\n$ cd github-gql-js\n```\n\n### Install system packages\n\nInstall Node.js - see [gist](https://gist.github.com/aa1fc56419a355972b96bce23f3bccba).\n\nYou also need `make` - standard on Linux and macOS. Otherwise run the commands directly in [Makefile](/Makefile).\n\n### Install project packages\n\n```sh\n$ make install\n```\n\n\n## Configuration\n\n1. Create a GitHub API token with appropriate permissions\n    - https://github.com/settings/tokens\n1. Copy the token value. Keep this **secret** and out of version control.\n1. Create a dotfile based on the template. This config file will be ignored by Git.\n    ```sh\n    $ cp .env.template .env\n    ```\n1. Paste your token in the file.\n\n\n## Usage\n\n```sh\n$ make run\n```\n\n\n## More info\n\n### GitHub APIs and tokens\n\nGitHub GQL queries require an  **API** token, unlike the REST API which does not.\n\nAvoid using the **browser** to do your GQL queries - you'll risk exposing your token to others on the internet.\n\nRather run your logic using **Node** on a server or in a serverless function (AWS Lambda or [Netlify Functions][]).\n\n[Netlify Functions]: https://michaelcurrin.github.io/dev-resources/resources/ci-cd/netlify/functions.html\n\n### Resources\n\n- [V4 GraphQL](https://michaelcurrin.github.io/dev-resources/resources/version-control/github/api/v4.html) in Dev Resources\n\n### Related\n\n- https://github.com/MichaelCurrin/github-gql-go - built with Go.\n- https://github.com/MichaelCurrin/github-reporting-py - built with Python.\n\n\n## License\n\nReleased under [MIT](/LICENSE) by [@MichaelCurrin](https://github.com/MichaelCurrin).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelcurrin%2Fgithub-gql-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelcurrin%2Fgithub-gql-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelcurrin%2Fgithub-gql-js/lists"}