https://github.com/kenmuse/gh-graphql-query-python
Sample Python application showing how to make a GraphQL query.
https://github.com/kenmuse/gh-graphql-query-python
gh-api graphql python sample
Last synced: 2 months ago
JSON representation
Sample Python application showing how to make a GraphQL query.
- Host: GitHub
- URL: https://github.com/kenmuse/gh-graphql-query-python
- Owner: kenmuse
- License: mit
- Created: 2022-05-26T18:09:19.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-26T19:20:05.000Z (about 3 years ago)
- Last Synced: 2025-02-12T19:48:40.623Z (4 months ago)
- Topics: gh-api, graphql, python, sample
- Language: Dockerfile
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GraphQL Query in Python
This repository provides demonstrates how to make a basic GitHub GraphQL query using Python. The application will query the current API rate limit and return the results.## Setup & Configuration
If you're using [GitHub Codespaces](https://github.com/features/codespaces) or [Visual Studio development containers](https://code.visualstudio.com/docs/remote/containers), then there's nothing special required. The container will automatically restore the needed packages.If you're not using a development container, you will need to install Python 3. After that, use `pip` to install the project's dependencies:
```bash
pip3 install --upgrade pip
pip3 install --user -r ./requirements.txt
```To run the application, you will need to create a GitHub [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) in your [Developer Settings](https://github.com/settings/tokens). This token will not require any privileges to be selected. If you modify the query, you will need to define appropriate privileges.
To run the sample, use the following command line. You will need to provide the token you created in the previous step.
```bash
python app.py {your-token}
```