GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Net::GitHub::V4(3) User Contributed Perl Documentation Net::GitHub::V4(3)
 

Net::GitHub::V4 - GitHub GraphQL API

    use Net::GitHub::V4;
    my $gh = Net::GitHub::V4->new(
        access_token => $oauth_token
    );
    my $data = $gh->query(<<'IQL');
query {
  repository(owner: "octocat", name: "Hello-World") {
    pullRequests(last: 10) {
      edges {
        node {
          number
          mergeable
        }
      }
    }
  }
}
IQL
    # mutation
    $data = $gh->query(<<'IQL');
mutation AddCommentToIssue {
  addComment(input:{subjectId:"MDU6SXNzdWUyMzA0ODQ2Mjg=", body:"A shiny new comment! :tada:"}) {
    commentEdge {
      cursor
    }
    subject {
      id
    }
    timelineEdge {
      cursor
    }
  }
}
IQL
    # variables
    $data = $gh->query(<<'IQL', { number_of_repos => 3 });
query($number_of_repos:Int!) {
  viewer {
    name
     repositories(last: $number_of_repos) {
       nodes {
         name
       }
     }
   }
}
IQL

<https://developer.github.com/v4/>

Authentication
access_token
    my $gh = Net::GitHub::V4->new( access_token => $ENV{GITHUB_ACCESS_TOKEN} );
    
raw_response
    my $gh = Net::GitHub::V4->new(
        # login/pass or access_token
        raw_response => 1
    );
return raw HTTP::Response object
raw_string
    my $gh = Net::GitHub::V4->new(
        # login/pass or access_token
        raw_string => 1
    );
return HTTP::Response response content as string
api_throttle
    my $gh = Net::GitHub::V4->new(
        # login/pass or access_token
        api_throttle => 0
    );
To disable call rate limiting (e.g. if your account is whitelisted), set api_throttle to 0.
ua
To set the proxy for ua, you can do something like following
    $gh->ua->proxy('https', 'socks://127.0.0.1:9050');
$gh->ua is an instance of LWP::UserAgent

query($method, $url, $data)
    my $data = $gh->query(<<IQL);
{
  repository(owner: "octocat", name: "Hello-World") {
    pullRequests(last: 10) {
      edges {
        node {
          number
          mergeable
        }
      }
    }
  }
}
IQL
GitHub GraphQL API

Pithub

Refer Net::GitHub
2018-03-30 perl v5.28.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.