Repository is archived
No commit activity in last 3 years
No release in over 3 years
A very thin GitHub GraphQL API v4 client
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.15
>= 0
~> 10.0
~> 3.0
 Project Readme

GithubApi::V4::Client

A very thin GitHub GraphQL API v4 client

Installation

Add this line to your application's Gemfile:

gem 'github_api-v4-client'

Usage

client = GithubApi::V4::Client.new("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")

client.schema
# {"data"=>
#   {"__schema"=>
#     {"types"=>
#       [{"name"=>"Repository",
#         "kind"=>"OBJECT",
#         "description"=>"A repository contains the content for a project.",
#         "fields"=>
#          [{"name"=>"nameWithOwner"},

client.graphql(query: 'query { repository(owner: "k0kubun", name: "hamlit") { nameWithOwner } }')
# {"data"=>{"repository"=>{"nameWithOwner"=>"k0kubun/hamlit"}}}

client.graphql(query: <<~QUERY, variables: { name: 'hamlit' })
  query Repository($name: String!) {
    repository(owner: "k0kubun", name: $name) {
      nameWithOwner
    }
  }
QUERY
# {"data"=>{"repository"=>{"nameWithOwner"=>"k0kubun/hamlit"}}}

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/k0kubun/github_api-v4-client.

License

The gem is available as open source under the terms of the MIT License.