Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 18 days 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 7 years ago)
- Default Branch: main
- Last Pushed: 2021-01-17T17:13:35.000Z (almost 4 years ago)
- Last Synced: 2024-10-13T21:47:48.051Z (about 1 month 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
![Release](https://img.shields.io/github/release/eneko/github.svg)
![Swift 4.2](https://img.shields.io/badge/Swift-4.2-orange.svg)
[![Build Status](https://travis-ci.org/eneko/GitHub.svg?branch=master)](https://travis-ci.org/eneko/GitHub)
[![codecov](https://codecov.io/gh/eneko/GitHub/branch/master/graph/badge.svg)](https://codecov.io/gh/eneko/GitHub)
[![Swift Package Manager Compatible](https://img.shields.io/badge/spm-compatible-brightgreen.svg)](https://swift.org/package-manager)
![Linux Compatible](https://img.shields.io/badge/linux-compatible%20🐧-brightgreen.svg)# 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
```