Categorygithub.com/djoksimo/githubv4
modulepackage
0.0.0-20190710190535-cbb8a9c39878
Repository: https://github.com/djoksimo/githubv4.git
Documentation: pkg.go.dev

# README

githubv4

Build Status GoDoc

Package githubv4 is a client library for accessing GitHub GraphQL API v4 (https://developer.github.com/v4/).

If you're looking for a client library for GitHub REST API v3, the recommended package is github.com/google/go-github/github.

Status: In research and development. The API will change when opportunities for improvement are discovered; it is not yet frozen.

Focus

  • Friendly, simple and powerful API.
  • Correctness, high performance and efficiency.
  • Support all of GitHub GraphQL API v4 via code generation from schema.

Installation

githubv4 requires Go version 1.8 or later.

go get -u github.com/djoksimo/githubv4

Usage

Authentication

GitHub GraphQL API v4 requires authentication. The githubv4 package does not directly handle authentication. Instead, when creating a new client, you're expected to pass an http.Client that performs authentication. The easiest and recommended way to do this is to use the golang.org/x/oauth2 package. You'll need an OAuth token from GitHub (for example, a personal API token) with the right scopes. Then:

import "golang.org/x/oauth2"

func main() {
	src := oauth2.StaticTokenSource(
		&oauth2.Token{AccessToken: os.Getenv("GITHUB_TOKEN")},
	)
	httpClient := oauth2.NewClient(context.Background(), src)

	client := githubv4.NewClient(httpClient)
	// Use client...
}

Simple Query

To make a query, you need to define a Go type that corresponds to the GitHub GraphQL schema, and contains the fields you're interested in querying. You can look up the GitHub GraphQL schema at https://developer.github.com/v4/query/.

For example, to make the following GraphQL query:

query {
	viewer {
		login
		createdAt
	}
}

You can define this variable:

var query struct {
	Viewer struct {
		Login     githubv4.String
		CreatedAt githubv4.DateTime
	}
}

Then call client.Query, passing a pointer to it:

err := client.Query(context.Background(), &query, nil)
if err != nil {
	// Handle error.
}
fmt.Println("    Login:", query.Viewer.Login)
fmt.Println("CreatedAt:", query.Viewer.CreatedAt)

// Output:
//     Login: gopher
// CreatedAt: 2017-05-26 21:17:14 +0000 UTC

Scalar Types

For each scalar in the GitHub GraphQL schema listed at https://developer.github.com/v4/scalar/, there is a corresponding Go type in package githubv4.

You can use these types when writing queries:

var query struct {
	Viewer struct {
		Login          githubv4.String
		CreatedAt      githubv4.DateTime
		IsBountyHunter githubv4.Boolean
		BioHTML        githubv4.HTML
		WebsiteURL     githubv4.URI
	}
}
// Call client.Query() and use results in query...

However, depending on how you're planning to use the results of your query, it's often more convenient to use other Go types.

The encoding/json rules are used for converting individual JSON-encoded fields from a GraphQL response into Go values. See https://godoc.org/encoding/json#Unmarshal for details. The json.Unmarshaler interface is respected.

That means you can simplify the earlier query by using predeclared Go types:

// import "time"

var query struct {
	Viewer struct {
		Login          string    // E.g., "gopher".
		CreatedAt      time.Time // E.g., time.Date(2017, 5, 26, 21, 17, 14, 0, time.UTC).
		IsBountyHunter bool      // E.g., true.
		BioHTML        string    // E.g., `I am learning <a href="https://graphql.org">GraphQL</a>!`.
		WebsiteURL     string    // E.g., "https://golang.org".
	}
}
// Call client.Query() and use results in query...

The DateTime scalar is described as "an ISO-8601 encoded UTC date string". If you wanted to fetch in that form without parsing it into a time.Time, you can use the string type. For example, this would work:

// import "html/template"

type MyBoolean bool

var query struct {
	Viewer struct {
		Login          string        // E.g., "gopher".
		CreatedAt      string        // E.g., "2017-05-26T21:17:14Z".
		IsBountyHunter MyBoolean     // E.g., MyBoolean(true).
		BioHTML        template.HTML // E.g., template.HTML(`I am learning <a href="https://graphql.org">GraphQL</a>!`).
		WebsiteURL     template.URL  // E.g., template.URL("https://golang.org").
	}
}
// Call client.Query() and use results in query...

Arguments and Variables

Often, you'll want to specify arguments on some fields. You can use the graphql struct field tag for this.

For example, to make the following GraphQL query:

{
	repository(owner: "octocat", name: "Hello-World") {
		description
	}
}

You can define this variable:

var q struct {
	Repository struct {
		Description string
	} `graphql:"repository(owner: \"octocat\", name: \"Hello-World\")"`
}

Then call client.Query:

err := client.Query(context.Background(), &q, nil)
if err != nil {
	// Handle error.
}
fmt.Println(q.Repository.Description)

// Output:
// My first repository on GitHub!

However, that'll only work if the arguments are constant and known in advance. Otherwise, you will need to make use of variables. Replace the constants in the struct field tag with variable names:

// fetchRepoDescription fetches description of repo with owner and name.
func fetchRepoDescription(ctx context.Context, owner, name string) (string, error) {
	var q struct {
		Repository struct {
			Description string
		} `graphql:"repository(owner: $owner, name: $name)"`
	}

When sending variables to GraphQL, you need to use exact types that match GraphQL scalar types, otherwise the GraphQL server will return an error.

So, define a variables map with their values that are converted to GraphQL scalar types:

	variables := map[string]interface{}{
		"owner": githubv4.String(owner),
		"name":  githubv4.String(name),
	}

Finally, call client.Query providing variables:

	err := client.Query(ctx, &q, variables)
	return q.Repository.Description, err
}

Inline Fragments

Some GraphQL queries contain inline fragments. You can use the graphql struct field tag to express them.

For example, to make the following GraphQL query:

{
	repositoryOwner(login: "github") {
		login
		... on Organization {
			description
		}
		... on User {
			bio
		}
	}
}

You can define this variable:

var q struct {
	RepositoryOwner struct {
		Login        string
		Organization struct {
			Description string
		} `graphql:"... on Organization"`
		User struct {
			Bio string
		} `graphql:"... on User"`
	} `graphql:"repositoryOwner(login: \"github\")"`
}

Alternatively, you can define the struct types corresponding to inline fragments, and use them as embedded fields in your query:

type (
	OrganizationFragment struct {
		Description string
	}
	UserFragment struct {
		Bio string
	}
)

var q struct {
	RepositoryOwner struct {
		Login                string
		OrganizationFragment `graphql:"... on Organization"`
		UserFragment         `graphql:"... on User"`
	} `graphql:"repositoryOwner(login: \"github\")"`
}

Then call client.Query:

err := client.Query(context.Background(), &q, nil)
if err != nil {
	// Handle error.
}
fmt.Println(q.RepositoryOwner.Login)
fmt.Println(q.RepositoryOwner.Description)
fmt.Println(q.RepositoryOwner.Bio)

// Output:
// github
// How people build software.
//

Pagination

Imagine you wanted to get a complete list of comments in an issue, and not just the first 10 or so. To do that, you'll need to perform multiple queries and use pagination information. For example:

type comment struct {
	Body   string
	Author struct {
		Login     string
		AvatarURL string `graphql:"avatarUrl(size: 72)"`
	}
	ViewerCanReact bool
}
var q struct {
	Repository struct {
		Issue struct {
			Comments struct {
				Nodes    []comment
				PageInfo struct {
					EndCursor   githubv4.String
					HasNextPage bool
				}
			} `graphql:"comments(first: 100, after: $commentsCursor)"` // 100 per page.
		} `graphql:"issue(number: $issueNumber)"`
	} `graphql:"repository(owner: $repositoryOwner, name: $repositoryName)"`
}
variables := map[string]interface{}{
	"repositoryOwner": githubv4.String(owner),
	"repositoryName":  githubv4.String(name),
	"issueNumber":     githubv4.Int(issue),
	"commentsCursor":  (*githubv4.String)(nil), // Null after argument to get first page.
}

// Get comments from all pages.
var allComments []comment
for {
	err := s.clQL.Query(ctx, &q, variables)
	if err != nil {
		return err
	}
	allComments = append(allComments, q.Repository.Issue.Comments.Nodes...)
	if !q.Repository.Issue.Comments.PageInfo.HasNextPage {
		break
	}
	variables["commentsCursor"] = githubv4.NewString(q.Repository.Issue.Comments.PageInfo.EndCursor)
}

There is more than one way to perform pagination. Consider additional fields inside PageInfo object.

Mutations

Mutations often require information that you can only find out by performing a query first. Let's suppose you've already done that.

For example, to make the following GraphQL mutation:

mutation($input: AddReactionInput!) {
	addReaction(input: $input) {
		reaction {
			content
		}
		subject {
			id
		}
	}
}
variables {
	"input": {
		"subjectId": "MDU6SXNzdWUyMTc5NTQ0OTc=",
		"content": "HOORAY"
	}
}

You can define:

var m struct {
	AddReaction struct {
		Reaction struct {
			Content githubv4.ReactionContent
		}
		Subject struct {
			ID githubv4.ID
		}
	} `graphql:"addReaction(input: $input)"`
}
input := githubv4.AddReactionInput{
	SubjectID: targetIssue.ID, // ID of the target issue from a previous query.
	Content:   githubv4.ReactionContentHooray,
}

Then call client.Mutate:

err := client.Mutate(context.Background(), &m, input, nil)
if err != nil {
	// Handle error.
}
fmt.Printf("Added a %v reaction to subject with ID %#v!\n", m.AddReaction.Reaction.Content, m.AddReaction.Subject.ID)

// Output:
// Added a HOORAY reaction to subject with ID "MDU6SXNzdWUyMTc5NTQ0OTc="!

Directories

PathSynopsis
example/githubv4devgithubv4dev is a test program currently being used for developing githubv4 package.

License

# Packages

No description provided by the author

# Functions

NewBoolean is a helper to make a new *Boolean.
NewClient creates a new GitHub GraphQL API v4 client with the provided http.Client.
NewDate is a helper to make a new *Date.
NewDateTime is a helper to make a new *DateTime.
NewEnterpriseClient creates a new GitHub GraphQL API v4 client for the GitHub Enterprise instance with the specified GraphQL endpoint URL, using the provided http.Client.
NewFloat is a helper to make a new *Float.
NewGitObjectID is a helper to make a new *GitObjectID.
NewGitTimestamp is a helper to make a new *GitTimestamp.
NewHTML is a helper to make a new *HTML.
NewID is a helper to make a new *ID.
NewInt is a helper to make a new *Int.
NewString is a helper to make a new *String.
NewURI is a helper to make a new *URI.
NewX509Certificate is a helper to make a new *X509Certificate.

# Constants

Order audit log entries by timestamp.
An annotation indicating an inescapable error.
An annotation indicating some information.
An annotation indicating an ignorable error.
The check suite or run requires action.
The check suite or run has been cancelled.
The check suite or run has failed.
The check suite or run was neutral.
The check suite or run has succeeded.
The check suite or run has timed out.
Every check run available.
The latest check run.
The check suite or run has been completed.
The check suite or run is in progress.
The check suite or run has been queued.
The check suite or run has been requested.
All collaborators the authenticated user can see.
All collaborators with permissions to an organization-owned subject, regardless of organization membership status.
All outside collaborators of an organization-owned subject.
Author has been invited to collaborate on the repository.
Author has previously committed to the repository.
Author has not previously committed to the repository.
Author has not previously committed to GitHub.
Author is a member of the organization that owns the repository.
Author has no association with the repository.
Author is the owner of the repository.
You cannot update this comment.
You must be the author or have write access to this repository to update this comment.
Unable to create comment because issue is locked.
You must be logged in to update this comment.
Repository is under maintenance.
At least one email address must be verified to update this comment.
Order commit contributions by how many commits they represent.
Order commit contributions by when they were made.
Order contributions by when they were made.
Can read, write, and administrate repos by default.
No access.
Can read repos by default.
Can read and write repos by default.
Order collection by creation time.
The pending deployment was not updated after 30 minutes.
The deployment is currently active.
An inactive transient deployment.
The deployment experienced an error.
The deployment has failed.
The deployment is inactive.
The deployment is in progress.
The deployment is pending.
The deployment has queued.
The deployment experienced an error.
The deployment has failed.
The deployment is inactive.
The deployment is in progress.
The deployment is pending.
The deployment is queued.
The deployment was successful.
Order gists by creation time.
Order gists by push time.
Order gists by update time.
Gists that are public and secret.
Public.
Secret.
The signing certificate or its chain could not be verified.
Invalid email used for signing.
Signing key expired.
Internal error - the GPG verification service misbehaved.
Internal error - the GPG verification service is unavailable at the moment.
Invalid signature.
Malformed signature.
The usage flags for the key that signed this don't allow signing.
Email used for signing not known to GitHub.
Valid siganture, though certificate revocation check failed.
Valid signature, pending certificate revocation checking.
One or more certificates in chain has been revoked.
Key used for signing not known to GitHub.
Unknown signature type.
Unsigned.
Email used for signing unverified on GitHub.
Valid signature and verified by GitHub.
Authentication with an identity provider is configured but not enforced.
Authentication with an identity provider is configured and enforced.
Authentication with an identity provider is not configured.
Order issues by comment count.
Order issues by creation time.
Order issues by update time.
The channel ID for marking an issue as read.
The channel ID for observing issue state updates.
The channel ID for updating items on the issue timeline.
The channel ID for observing issue updates.
An issue that has been closed.
An issue that is still open.
Represents a 'added_to_project' event on a given issue or pull request.
Represents an 'assigned' event on any assignable object.
Represents a 'closed' event on any `Closable`.
Represents a 'comment_deleted' event on a given issue or pull request.
Represents a 'converted_note_to_issue' event on a given issue or pull request.
Represents a mention made by one issue or pull request to another.
Represents a 'demilestoned' event on a given issue or pull request.
Represents a comment on an Issue.
Represents a 'labeled' event on a given issue or pull request.
Represents a 'locked' event on a given issue or pull request.
Represents a 'mentioned' event on a given issue or pull request.
Represents a 'milestoned' event on a given issue or pull request.
Represents a 'moved_columns_in_project' event on a given issue or pull request.
Represents a 'pinned' event on a given issue or pull request.
Represents a 'referenced' event on a given `ReferencedSubject`.
Represents a 'removed_from_project' event on a given issue or pull request.
Represents a 'renamed' event on a given issue or pull request.
Represents a 'reopened' event on any `Closable`.
Represents a 'subscribed' event on a given `Subscribable`.
Represents a 'transferred' event on a given issue or pull request.
Represents an 'unassigned' event on any assignable object.
Represents an 'unlabeled' event on a given issue or pull request.
Represents an 'unlocked' event on a given issue or pull request.
Represents an 'unpinned' event on a given issue or pull request.
Represents an 'unsubscribed' event on a given `Subscribable`.
Represents a 'user_blocked' event on a given user.
Order languages by the size of all files containing the language.
The issue or pull request was locked because the conversation was off-topic.
The issue or pull request was locked because the conversation was resolved.
The issue or pull request was locked because the conversation was spam.
The issue or pull request was locked because the conversation was too heated.
The pull request cannot be merged due to merge conflicts.
The pull request can be merged.
The mergeability of the pull request is still being calculated.
The head ref is out of date.
The merge is blocked.
Mergeable and passing commit status.
The merge commit cannot be cleanly created.
The merge is blocked due to the pull request being a draft.
Mergeable with passing commit status and pre-recieve hooks.
The state cannot currently be determined.
Mergeable with non-passing commit status.
Order milestones by when they were created.
Order milestones by when they are due.
Order milestones by their number.
Order milestones by when they were last updated.
A milestone that has been closed.
A milestone that is still open.
The OAuth Application was active and allowed to have OAuth Accesses.
The OAuth Application was in the process of being deleted.
The OAuth Application was suspended from generating OAuth Accesses due to abuse or security concerns.
The OAuth Application was active and allowed to have OAuth Accesses.
The OAuth Application was in the process of being deleted.
The OAuth Application was suspended from generating OAuth Accesses due to abuse or security concerns.
Specifies an ascending order for a given `orderBy` argument.
Specifies a descending order for a given `orderBy` argument.
Can read, clone, push, and add collaborators to repositories.
Can read and clone repositories.
The user is invited to be an admin of the organization.
The user is invited to be a billing manager of the organization.
The user is invited to be a direct member of the organization.
The user's previous role will be reinstated.
The invitation was to an email address.
The invitation was to an existing user.
The user is an administrator of the organization.
The user is a member of the organization.
SAML external identity missing.
SAML SSO enforcement requires an external identity.
The organization required 2FA of its billing managers and this user did not have 2FA enabled.
Organization administrators have full access and can change several settings, including the names of repositories that belong to the Organization and Owners team membership.
A billing manager is a user who manages the billing settings for the Organization, such as updating payment information.
A direct member is a user that is a member of the Organization.
An outside collaborator is a person who isn't explicitly a member of the Organization, but who has Read, Write, or Admin permissions to one or more repositories in the organization.
An unaffiliated collaborator is a person who is not a member of the Organization and does not have access to any repositories in the Organization.
SAML external identity missing.
SAML SSO enforcement requires an external identity.
The organization required 2FA of its billing managers and this user did not have 2FA enabled.
A billing manager is a user who manages the billing settings for the Organization, such as updating payment information.
An outside collaborator is a person who isn't explicitly a member of the Organization, but who has Read, Write, or Admin permissions to one or more repositories in the organization.
An unaffiliated collaborator is a person who is not a member of the Organization and does not have access to any repositories in the organization.
SAML external identity missing.
The organization required 2FA of its billing managers and this user did not have 2FA enabled.
Can read, clone, push, and add collaborators to repositories.
No default permission value.
Can read and clone repositories.
Can read, clone and push to repositories.
Can read, clone, push, and add collaborators to repositories.
Can read and clone repositories.
All organization members are restricted from creating any repositories.
All organization members are restricted from creating public repositories.
A gist.
An issue.
An organization.
A project.
A pull request.
A repository.
A team.
A user.
A project card that is archived.
A project card that is not archived.
The card has content only.
The card has a note only.
The card is redacted.
The column contains cards which are complete.
The column contains cards which are currently being worked on.
The column contains cards still to be worked on.
Order projects by creation time.
Order projects by name.
Order projects by update time.
The project is closed.
The project is open.
Order pull_requests by creation time.
Order pull_requests by update time.
The channel ID for observing head ref updates.
The channel ID for marking an pull request as read.
The channel ID for observing pull request state updates.
The channel ID for updating items on the pull request timeline.
The channel ID for observing pull request updates.
A comment that is part of a pending review.
A comment that is part of a submitted review.
Submit feedback and approve merging these changes.
Submit general feedback without explicit approval.
Dismiss review so it now longer effects merging.
Submit feedback that must be addressed before merging.
A review allowing the pull request to merge.
A review blocking the pull request from merging.
An informational review.
A review that has been dismissed.
A review that has not yet been submitted.
A pull request that has been closed without being merged.
A pull request that has been closed by being merged.
A pull request that is still open.
Represents a 'added_to_project' event on a given issue or pull request.
Represents an 'assigned' event on any assignable object.
Represents a 'base_ref_changed' event on a given issue or pull request.
Represents a 'base_ref_force_pushed' event on a given pull request.
Represents a 'closed' event on any `Closable`.
Represents a 'comment_deleted' event on a given issue or pull request.
Represents a 'converted_note_to_issue' event on a given issue or pull request.
Represents a mention made by one issue or pull request to another.
Represents a 'demilestoned' event on a given issue or pull request.
Represents a 'deployed' event on a given pull request.
Represents a 'deployment_environment_changed' event on a given pull request.
Represents a 'head_ref_deleted' event on a given pull request.
Represents a 'head_ref_force_pushed' event on a given pull request.
Represents a 'head_ref_restored' event on a given pull request.
Represents a comment on an Issue.
Represents a 'labeled' event on a given issue or pull request.
Represents a 'locked' event on a given issue or pull request.
Represents a 'mentioned' event on a given issue or pull request.
Represents a 'merged' event on a given pull request.
Represents a 'milestoned' event on a given issue or pull request.
Represents a 'moved_columns_in_project' event on a given issue or pull request.
Represents a 'pinned' event on a given issue or pull request.
Represents a Git commit part of a pull request.
Represents a commit comment thread part of a pull request.
A review object for a given pull request.
A threaded list of comments for a given pull request.
Represents the latest point in the pull request timeline for which the viewer has seen the pull request's commits.
Represents a 'ready_for_review' event on a given pull request.
Represents a 'referenced' event on a given `ReferencedSubject`.
Represents a 'removed_from_project' event on a given issue or pull request.
Represents a 'renamed' event on a given issue or pull request.
Represents a 'reopened' event on any `Closable`.
Represents a 'review_dismissed' event on a given issue or pull request.
Represents an 'review_requested' event on a given pull request.
Represents an 'review_request_removed' event on a given pull request.
Represents a 'subscribed' event on a given `Subscribable`.
Represents a 'transferred' event on a given issue or pull request.
Represents an 'unassigned' event on any assignable object.
Represents an 'unlabeled' event on a given issue or pull request.
Represents an 'unlocked' event on a given issue or pull request.
Represents an 'unpinned' event on a given issue or pull request.
Represents an 'unsubscribed' event on a given `Subscribable`.
Represents a 'user_blocked' event on a given user.
Represents the 😕 emoji.
Represents the 👀 emoji.
Represents the ❤️ emoji.
Represents the 🎉 emoji.
Represents the 😄 emoji.
Represents the 🚀 emoji.
Represents the 👎 emoji.
Represents the 👍 emoji.
Allows ordering a list of reactions by when they were created.
Order refs by their alphanumeric name.
Order refs by underlying commit date if the ref prefix is refs/tags/.
Order releases by creation time.
Order releases alphabetically by name.
The repository is visible only to users in the same business.
The repository is visible only to those with explicit access.
The repository is visible to everyone.
The repository is visible only to users in the same business.
The repository is visible only to those with explicit access.
The repository is visible to everyone.
The repository is visible only to users in the same business.
The repository is visible only to those with explicit access.
The repository is visible to everyone.
An abusive or harassing piece of content.
An irrelevant piece of content.
An outdated piece of content.
The content has been resolved.
A spammy piece of content.
Repositories that the user has been added to as a collaborator.
Repositories that the user has access to through being a member of an organization.
Repositories that are owned by the authenticated user.
All collaborators of the repository.
All outside collaborators of an organization-owned repository.
Created a commit.
Created an issue.
Created a pull request.
Reviewed a pull request.
Created the repository.
The repository is locked due to a billing related reason.
The repository is locked due to a migration.
The repository is locked due to a move.
The repository is locked due to a rename.
Order repositories by creation time.
Order repositories by name.
Order repositories by push time.
Order repositories by number of stargazers.
Order repositories by update time.
Can read, clone, and push to this repository.
Can read, clone, and push to this repository.
Can read and clone this repository.
Can read and clone this repository.
Can read, clone, and push to this repository.
Private.
Public.
The repository is visible only to users in the same business.
The repository is visible only to those with explicit access.
The repository is visible to everyone.
The check suite or run has been completed.
The check suite or run is in progress.
The check suite or run has been queued.
Returns results matching issues in repositories.
Returns results matching repositories.
Returns results matching users and organizations on GitHub.
Java artifacts hosted at the Maven central repository.
JavaScript packages hosted at npmjs.com.
.NET packages hosted at the NuGet Gallery.
Python packages hosted at PyPI.org.
Ruby gems hosted at RubyGems.org.
Common Vulnerabilities and Exposures Identifier.
GitHub Security Advisory ID.
Order advisories by publication time.
Order advisories by update time.
Critical.
High.
Low.
Moderate.
Order vulnerability by update time.
Allows ordering a list of stars by when they were created.
Status is errored.
Status is expected.
Status is failing.
Status is pending.
Status is successful.
The User is never notified.
The User is notified of all conversations.
The User is only notified when participating or @mentioned.
Allows sequential ordering of team discussion comments (which is equivalent to chronological ordering).
Allows chronological ordering of team discussions.
Order team members by creation time.
Order team members by login.
A team maintainer has permission to add and remove team members.
A team member has no administrative permissions on the team.
Includes immediate and child team members for the team.
Includes only child team members for the team.
Includes only immediate members of the team.
Allows ordering a list of teams by name.
A secret team can only be seen by its members.
A visible team can be seen and @mentioned by every member of the organization.
Order repositories by creation time.
Order repositories by name.
Order repositories by permission.
Order repositories by push time.
Order repositories by number of stargazers.
Order repositories by update time.
User has admin rights on the team.
User is a member of the team.
The suggested topic is not relevant to the repository.
The viewer does not like the suggested topic.
The suggested topic is too general for the repository.
The suggested topic is too specific for the repository (e.g.
The user was blocked for 1 day.
The user was blocked for 30 days.
The user was blocked for 7 days.
The user was blocked permanently.
The user was blocked for 3 days.
Order user statuses by when they were updated.

# Structs

AcceptTopicSuggestionInput is an autogenerated input type of AcceptTopicSuggestion.
AddAssigneesToAssignableInput is an autogenerated input type of AddAssigneesToAssignable.
AddCommentInput is an autogenerated input type of AddComment.
AddLabelsToLabelableInput is an autogenerated input type of AddLabelsToLabelable.
AddProjectCardInput is an autogenerated input type of AddProjectCard.
AddProjectColumnInput is an autogenerated input type of AddProjectColumn.
AddPullRequestReviewCommentInput is an autogenerated input type of AddPullRequestReviewComment.
AddPullRequestReviewInput is an autogenerated input type of AddPullRequestReview.
AddReactionInput is an autogenerated input type of AddReaction.
AddStarInput is an autogenerated input type of AddStar.
AuditLogOrder represents ordering options for Audit Log connections.
ChangeUserStatusInput is an autogenerated input type of ChangeUserStatus.
CheckAnnotationData represents information from a check run analysis to specific lines of code.
CheckAnnotationRange represents information from a check run analysis to specific lines of code.
CheckRunAction represents possible further actions the integrator can perform.
CheckRunFilter represents the filters that are available when fetching check runs.
CheckRunOutput represents descriptive details about the check run.
CheckRunOutputImage represents images attached to the check run output displayed in the GitHub pull request UI.
CheckSuiteAutoTriggerPreference represents the auto-trigger preferences that are available for check suites.
CheckSuiteFilter represents the filters that are available when fetching check suites.
ClearLabelsFromLabelableInput is an autogenerated input type of ClearLabelsFromLabelable.
Client is a GitHub GraphQL API v4 client.
CloneProjectInput is an autogenerated input type of CloneProject.
CloneTemplateRepositoryInput is an autogenerated input type of CloneTemplateRepository.
CloseIssueInput is an autogenerated input type of CloseIssue.
ClosePullRequestInput is an autogenerated input type of ClosePullRequest.
CommitAuthor specifies an author for filtering Git commits.
CommitContributionOrder represents ordering options for commit contribution connections.
ContributionOrder represents ordering options for contribution connections.
ConvertProjectCardNoteToIssueInput is an autogenerated input type of ConvertProjectCardNoteToIssue.
CreateBranchProtectionRuleInput is an autogenerated input type of CreateBranchProtectionRule.
CreateCheckRunInput is an autogenerated input type of CreateCheckRun.
CreateCheckSuiteInput is an autogenerated input type of CreateCheckSuite.
CreateContentAttachmentInput is an autogenerated input type of CreateContentAttachment.
CreateDeploymentInput is an autogenerated input type of CreateDeployment.
CreateDeploymentStatusInput is an autogenerated input type of CreateDeploymentStatus.
CreateIssueInput is an autogenerated input type of CreateIssue.
CreateLabelInput is an autogenerated input type of CreateLabel.
CreateProjectInput is an autogenerated input type of CreateProject.
CreatePullRequestInput is an autogenerated input type of CreatePullRequest.
CreateRefInput is an autogenerated input type of CreateRef.
CreateRepositoryInput is an autogenerated input type of CreateRepository.
CreateTeamDiscussionCommentInput is an autogenerated input type of CreateTeamDiscussionComment.
CreateTeamDiscussionInput is an autogenerated input type of CreateTeamDiscussion.
No description provided by the author
No description provided by the author
DeclineTopicSuggestionInput is an autogenerated input type of DeclineTopicSuggestion.
DeleteBranchProtectionRuleInput is an autogenerated input type of DeleteBranchProtectionRule.
DeleteIssueCommentInput is an autogenerated input type of DeleteIssueComment.
DeleteIssueInput is an autogenerated input type of DeleteIssue.
DeleteLabelInput is an autogenerated input type of DeleteLabel.
DeleteProjectCardInput is an autogenerated input type of DeleteProjectCard.
DeleteProjectColumnInput is an autogenerated input type of DeleteProjectColumn.
DeleteProjectInput is an autogenerated input type of DeleteProject.
DeletePullRequestReviewCommentInput is an autogenerated input type of DeletePullRequestReviewComment.
DeletePullRequestReviewInput is an autogenerated input type of DeletePullRequestReview.
DeleteRefInput is an autogenerated input type of DeleteRef.
DeleteTeamDiscussionCommentInput is an autogenerated input type of DeleteTeamDiscussionComment.
DeleteTeamDiscussionInput is an autogenerated input type of DeleteTeamDiscussion.
DeploymentOrder represents ordering options for deployment connections.
DismissPullRequestReviewInput is an autogenerated input type of DismissPullRequestReview.
DraftPullRequestReviewComment specifies a review comment to be left with a Pull Request Review.
GistOrder represents ordering options for gist connections.
No description provided by the author
ImportProjectInput is an autogenerated input type of ImportProject.
IssueFilters represents ways in which to filter lists of issues.
IssueOrder represents ways in which lists of issues can be ordered upon return.
LanguageOrder represents ordering options for language connections.
LockLockableInput is an autogenerated input type of LockLockable.
MarkPullRequestReadyForReviewInput is an autogenerated input type of MarkPullRequestReadyForReview.
MergePullRequestInput is an autogenerated input type of MergePullRequest.
MilestoneOrder represents ordering options for milestone connections.
MinimizeCommentInput is an autogenerated input type of MinimizeComment.
MoveProjectCardInput is an autogenerated input type of MoveProjectCard.
MoveProjectColumnInput is an autogenerated input type of MoveProjectColumn.
PinIssueInput is an autogenerated input type of PinIssue.
ProjectCardImport represents an issue or PR and its owning repository to be used in a project card.
ProjectColumnImport represents a project column and a list of its issues and PRs.
ProjectOrder represents ways in which lists of projects can be ordered upon return.
PullRequestOrder represents ways in which lists of issues can be ordered upon return.
ReactionOrder represents ways in which lists of reactions can be ordered upon return.
RefOrder represents ways in which lists of git refs can be ordered upon return.
ReleaseOrder represents ways in which lists of releases can be ordered upon return.
RemoveAssigneesFromAssignableInput is an autogenerated input type of RemoveAssigneesFromAssignable.
RemoveLabelsFromLabelableInput is an autogenerated input type of RemoveLabelsFromLabelable.
RemoveOutsideCollaboratorInput is an autogenerated input type of RemoveOutsideCollaborator.
RemoveReactionInput is an autogenerated input type of RemoveReaction.
RemoveStarInput is an autogenerated input type of RemoveStar.
ReopenIssueInput is an autogenerated input type of ReopenIssue.
ReopenPullRequestInput is an autogenerated input type of ReopenPullRequest.
RepositoryOrder represents ordering options for repository connections.
RequestReviewsInput is an autogenerated input type of RequestReviews.
RerequestCheckSuiteInput is an autogenerated input type of RerequestCheckSuite.
ResolveReviewThreadInput is an autogenerated input type of ResolveReviewThread.
SecurityAdvisoryIdentifierFilter represents an advisory identifier to filter results on.
SecurityAdvisoryOrder represents ordering options for security advisory connections.
SecurityVulnerabilityOrder represents ordering options for security vulnerability connections.
StarOrder represents ways in which star connections can be ordered.
SubmitPullRequestReviewInput is an autogenerated input type of SubmitPullRequestReview.
TeamDiscussionCommentOrder represents ways in which team discussion comment connections can be ordered.
TeamDiscussionOrder represents ways in which team discussion connections can be ordered.
TeamMemberOrder represents ordering options for team member connections.
TeamOrder represents ways in which team connections can be ordered.
TeamRepositoryOrder represents ordering options for team repository connections.
UnlockLockableInput is an autogenerated input type of UnlockLockable.
UnmarkIssueAsDuplicateInput is an autogenerated input type of UnmarkIssueAsDuplicate.
UnminimizeCommentInput is an autogenerated input type of UnminimizeComment.
UnpinIssueInput is an autogenerated input type of UnpinIssue.
UnresolveReviewThreadInput is an autogenerated input type of UnresolveReviewThread.
UpdateBranchProtectionRuleInput is an autogenerated input type of UpdateBranchProtectionRule.
UpdateCheckRunInput is an autogenerated input type of UpdateCheckRun.
UpdateCheckSuitePreferencesInput is an autogenerated input type of UpdateCheckSuitePreferences.
UpdateIssueCommentInput is an autogenerated input type of UpdateIssueComment.
UpdateIssueInput is an autogenerated input type of UpdateIssue.
UpdateLabelInput is an autogenerated input type of UpdateLabel.
UpdateProjectCardInput is an autogenerated input type of UpdateProjectCard.
UpdateProjectColumnInput is an autogenerated input type of UpdateProjectColumn.
UpdateProjectInput is an autogenerated input type of UpdateProject.
UpdatePullRequestInput is an autogenerated input type of UpdatePullRequest.
UpdatePullRequestReviewCommentInput is an autogenerated input type of UpdatePullRequestReviewComment.
UpdatePullRequestReviewInput is an autogenerated input type of UpdatePullRequestReview.
UpdateRefInput is an autogenerated input type of UpdateRef.
UpdateSubscriptionInput is an autogenerated input type of UpdateSubscription.
UpdateTeamDiscussionCommentInput is an autogenerated input type of UpdateTeamDiscussionComment.
UpdateTeamDiscussionInput is an autogenerated input type of UpdateTeamDiscussion.
UpdateTopicsInput is an autogenerated input type of UpdateTopics.
No description provided by the author
UserStatusOrder represents ordering options for user status connections.
No description provided by the author

# Interfaces

Input represents one of the Input structs: AcceptTopicSuggestionInput, AddAssigneesToAssignableInput, AddCommentInput, AddLabelsToLabelableInput, AddProjectCardInput, AddProjectColumnInput, AddPullRequestReviewCommentInput, AddPullRequestReviewInput, AddReactionInput, AddStarInput, AuditLogOrder, ChangeUserStatusInput, CheckAnnotationData, CheckAnnotationRange, CheckRunAction, CheckRunFilter, CheckRunOutput, CheckRunOutputImage, CheckSuiteAutoTriggerPreference, CheckSuiteFilter, ClearLabelsFromLabelableInput, CloneProjectInput, CloneTemplateRepositoryInput, CloseIssueInput, ClosePullRequestInput, CommitAuthor, CommitContributionOrder, ContributionOrder, ConvertProjectCardNoteToIssueInput, CreateBranchProtectionRuleInput, CreateCheckRunInput, CreateCheckSuiteInput, CreateContentAttachmentInput, CreateDeploymentInput, CreateDeploymentStatusInput, CreateIssueInput, CreateLabelInput, CreateProjectInput, CreatePullRequestInput, CreateRefInput, CreateRepositoryInput, CreateTeamDiscussionCommentInput, CreateTeamDiscussionInput, DeclineTopicSuggestionInput, DeleteBranchProtectionRuleInput, DeleteIssueCommentInput, DeleteIssueInput, DeleteLabelInput, DeleteProjectCardInput, DeleteProjectColumnInput, DeleteProjectInput, DeletePullRequestReviewCommentInput, DeletePullRequestReviewInput, DeleteRefInput, DeleteTeamDiscussionCommentInput, DeleteTeamDiscussionInput, DeploymentOrder, DismissPullRequestReviewInput, DraftPullRequestReviewComment, GistOrder, ImportProjectInput, IssueFilters, IssueOrder, LanguageOrder, LockLockableInput, MarkPullRequestReadyForReviewInput, MergePullRequestInput, MilestoneOrder, MinimizeCommentInput, MoveProjectCardInput, MoveProjectColumnInput, PinIssueInput, ProjectCardImport, ProjectColumnImport, ProjectOrder, PullRequestOrder, ReactionOrder, RefOrder, ReleaseOrder, RemoveAssigneesFromAssignableInput, RemoveLabelsFromLabelableInput, RemoveOutsideCollaboratorInput, RemoveReactionInput, RemoveStarInput, ReopenIssueInput, ReopenPullRequestInput, RepositoryOrder, RequestReviewsInput, RerequestCheckSuiteInput, ResolveReviewThreadInput, SecurityAdvisoryIdentifierFilter, SecurityAdvisoryOrder, SecurityVulnerabilityOrder, StarOrder, SubmitPullRequestReviewInput, TeamDiscussionCommentOrder, TeamDiscussionOrder, TeamMemberOrder, TeamOrder, TeamRepositoryOrder, UnlockLockableInput, UnmarkIssueAsDuplicateInput, UnminimizeCommentInput, UnpinIssueInput, UnresolveReviewThreadInput, UpdateBranchProtectionRuleInput, UpdateCheckRunInput, UpdateCheckSuitePreferencesInput, UpdateIssueCommentInput, UpdateIssueInput, UpdateLabelInput, UpdateProjectCardInput, UpdateProjectColumnInput, UpdateProjectInput, UpdatePullRequestInput, UpdatePullRequestReviewCommentInput, UpdatePullRequestReviewInput, UpdateRefInput, UpdateSubscriptionInput, UpdateTeamDiscussionCommentInput, UpdateTeamDiscussionInput, UpdateTopicsInput, UserStatusOrder.

# Type aliases

AuditLogOrderField represents properties by which Audit Log connections can be ordered.
No description provided by the author
CheckAnnotationLevel represents represents an annotation's information level.
CheckConclusionState represents the possible states for a check suite or run conclusion.
CheckRunType represents the possible types of check runs.
CheckStatusState represents the possible states for a check suite or run status.
CollaboratorAffiliation represents collaborators affiliation level with a subject.
CommentAuthorAssociation represents a comment author association with repository.
CommentCannotUpdateReason represents the possible errors that will prevent a user from updating a comment.
CommitContributionOrderField represents properties by which commit contribution connections can be ordered.
ContributionOrderField represents properties by which contribution connections can be ordered.
DefaultRepositoryPermissionField represents the possible default permissions for repositories.
DeploymentOrderField represents properties by which deployment connections can be ordered.
DeploymentState represents the possible states in which a deployment can be.
DeploymentStatusState represents the possible states for a deployment status.
No description provided by the author
GistOrderField represents properties by which gist connections can be ordered.
GistPrivacy represents the privacy of a Gist.
No description provided by the author
GitSignatureState represents the state of a Git signature.
No description provided by the author
No description provided by the author
IdentityProviderConfigurationState represents the possible states in which authentication can be configured with an identity provider.
No description provided by the author
IssueOrderField represents properties by which issue connections can be ordered.
IssuePubSubTopic represents the possible PubSub channels for an issue.
IssueState represents the possible states of an issue.
IssueTimelineItemsItemType represents the possible item types found in a timeline.
LanguageOrderField represents properties by which language connections can be ordered.
LockReason represents the possible reasons that an issue or pull request was locked.
MergeableState represents whether or not a PullRequest can be merged.
MergeStateStatus represents detailed status information about a pull request merge.
MilestoneOrderField represents properties by which milestone connections can be ordered.
MilestoneState represents the possible states of a milestone.
OauthApplicationCreateAuditEntryState represents the state of an OAuth Application when it was created.
OauthApplicationRevokeTokensAuditEntryState represents the state of an OAuth Application when its tokens were revoked.
OrderDirection represents possible directions in which to order a list of items when provided an `orderBy` argument.
OrgAddMemberAuditEntryPermission represents the permissions available to members on an Organization.
OrganizationInvitationRole represents the possible organization invitation roles.
OrganizationInvitationType represents the possible organization invitation types.
OrganizationMemberRole represents the possible roles within an organization for its members.
OrgRemoveBillingManagerAuditEntryReason represents the reason a billing manager was removed from an Organization.
OrgRemoveMemberAuditEntryMembershipType represents the type of membership a user has with an Organization.
OrgRemoveMemberAuditEntryReason represents the reason a member was removed from an Organization.
OrgRemoveOutsideCollaboratorAuditEntryMembershipType represents the type of membership a user has with an Organization.
OrgRemoveOutsideCollaboratorAuditEntryReason represents the reason an outside collaborator was removed from an Organization.
OrgUpdateDefaultRepositoryPermissionAuditEntryPermission represents the default permission a repository can have in an Organization.
OrgUpdateMemberAuditEntryPermission represents the permissions available to members on an Organization.
OrgUpdateMemberRepositoryCreationPermissionAuditEntryVisibility represents the permissions available for repository creation on an Organization.
PinnableItemType represents represents items that can be pinned to a profile page or dashboard.
ProjectCardArchivedState represents the possible archived states of a project card.
ProjectCardState represents various content states of a ProjectCard.
ProjectColumnPurpose represents the semantic purpose of the column - todo, in progress, or done.
ProjectOrderField represents properties by which project connections can be ordered.
ProjectState represents state of the project; either 'open' or 'closed'.
PullRequestOrderField represents properties by which pull_requests connections can be ordered.
PullRequestPubSubTopic represents the possible PubSub channels for a pull request.
PullRequestReviewCommentState represents the possible states of a pull request review comment.
PullRequestReviewEvent represents the possible events to perform on a pull request review.
PullRequestReviewState represents the possible states of a pull request review.
PullRequestState represents the possible states of a pull request.
PullRequestTimelineItemsItemType represents the possible item types found in a timeline.
ReactionContent represents emojis that can be attached to Issues, Pull Requests and Comments.
ReactionOrderField represents a list of fields that reactions can be ordered by.
RefOrderField represents properties by which ref connections can be ordered.
ReleaseOrderField represents properties by which release connections can be ordered.
RepoAccessAuditEntryVisibility represents the privacy of a repository.
RepoAddMemberAuditEntryVisibility represents the privacy of a repository.
RepoRemoveMemberAuditEntryVisibility represents the privacy of a repository.
ReportedContentClassifiers represents the reasons a piece of content can be reported or minimized.
RepositoryAffiliation represents the affiliation of a user to a repository.
RepositoryCollaboratorAffiliation represents the affiliation type between collaborator and repository.
RepositoryContributionType represents the reason a repository is listed as 'contributed'.
RepositoryLockReason represents the possible reasons a given repository could be in a locked state.
RepositoryOrderField represents properties by which repository connections can be ordered.
RepositoryPermission represents the access level to a repository.
RepositoryPrivacy represents the privacy of a repository.
RepositoryVisibility represents the repository's visibility level.
RequestableCheckStatusState represents the possible states that can be requested when creating a check run.
SearchType represents represents the individual results of a search.
SecurityAdvisoryEcosystem represents the possible ecosystems of a security vulnerability's package.
SecurityAdvisoryIdentifierType represents identifier formats available for advisories.
SecurityAdvisoryOrderField represents properties by which security advisory connections can be ordered.
SecurityAdvisorySeverity represents severity of the vulnerability.
SecurityVulnerabilityOrderField represents properties by which security vulnerability connections can be ordered.
StarOrderField represents properties by which star connections can be ordered.
StatusState represents the possible commit status states.
No description provided by the author
SubscriptionState represents the possible states of a subscription.
TeamDiscussionCommentOrderField represents properties by which team discussion comment connections can be ordered.
TeamDiscussionOrderField represents properties by which team discussion connections can be ordered.
TeamMemberOrderField represents properties by which team member connections can be ordered.
TeamMemberRole represents the possible team member roles; either 'maintainer' or 'member'.
TeamMembershipType represents defines which types of team members are included in the returned list.
TeamOrderField represents properties by which team connections can be ordered.
TeamPrivacy represents the possible team privacy values.
TeamRepositoryOrderField represents properties by which team repository connections can be ordered.
TeamRole represents the role of a user on a team.
TopicSuggestionDeclineReason represents reason that the suggested topic is declined.
UserBlockDuration represents the possible durations that a user can be blocked for.
UserStatusOrderField represents properties by which user status connections can be ordered.