Net::GitHub::V4(3pm)
π NAME π
Net::GitHub::V4 β it's giving GitHub GraphQL API, bestie. That's the whole vibe. π¦
β¨ SYNOPSIS β¨
okay so here's how you actually use it, no cap:
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
queries? mutations? variables?? we do it all here, periodt. π
π DESCRIPTION π
the docs live at <https://developer.github.com/v4/> and they are right there, bestie, go read them when you need the deep lore π«Ά
π ATTRIBUTES π
π Authentication π
access_token
my $gh = Net::GitHub::V4->new( access_token => $ENV{GITHUB_ACCESS_TOKEN} );
yes, straight from your env var, iconic behavior honestly π
raw_response
my $gh = Net::GitHub::V4->new(
# login/pass or access_token
raw_response => 1
);
return raw HTTP::Response object β¨ (like, the whole object, untouched, main character energy)
raw_string
my $gh = Net::GitHub::V4->new(
# login/pass or access_token
raw_string => 1
);
return HTTP::Response response content as string π§ (just the string, bestie, no wrapper)
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), setapi_throttleto0.
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 π
π οΈ METHODS π οΈ
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 β that's the whole assignment. go off. π₯
π SEE ALSO π
Pithubβ the other one, iykyk π«
π AUTHOR & COPYRIGHT & LICENSE π
Refer Net::GitHub β (they said it, not me, but it's the truth bestie)
and that's the whole page, babe π this was Net::GitHub::V4(3pm) from the User Contributed Perl Documentation, running on perl v5.36.0, dated 2022-10-08 β slay, ate, no crumbs left. πβ¨π¦
π¦ where this page comes from
- ubuntu noble: libnet-github-perl 1.05-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libnet-github-perl 1.05-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnet-github-perl 1.05-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms