https://github.com/eneko/github
Swift Package client for the GitHub GraphQL API V4
https://github.com/eneko/github
api api-client github graphql library swift swift-package swift-package-manager
Last synced: 3 months ago
JSON representation
Swift Package client for the GitHub GraphQL API V4
- Host: GitHub
- URL: https://github.com/eneko/github
- Owner: eneko
- Created: 2017-12-20T22:33:29.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2021-01-17T17:13:35.000Z (almost 5 years ago)
- Last Synced: 2025-01-10T19:28:06.791Z (11 months ago)
- Topics: api, api-client, github, graphql, library, swift, swift-package, swift-package-manager
- Language: Swift
- Size: 16.6 KB
- Stars: 13
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README


[](https://travis-ci.org/eneko/GitHub)
[](https://codecov.io/gh/eneko/GitHub)
[](https://swift.org/package-manager)

# GitHub GraphQL API V4 client
This is a client for the [GitHub GraphQL API V4](https://developer.github.com/v4/).
Note: This client is in very early stages and currently has extremely limited functionality:
- Retrieve version tag for lastest release from a given repository.
- Retrieve list of open pull requests from a given repository.
## Usage
Initialize a client passing in a valid GitHub access token:
```swift
let token = "your_token"
let github = GitHub(token: token)
```
Retrieve latest release version of a given project:
```swift
let version = try github.latestRelease(owner: "eneko", project: "SourceDocs")
print(version) // 0.5.0
```
Retrieve list of open pull requests on a given project:
```swift
let pullRequests = try github.openPullRequests(owner: "eneko", project: "SourceDocs")
print(pullRequests.count) // 0
```