api

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const FeatureIssueTypes = "issue_types"

FeatureIssueTypes is the GitHub API preview header for issue types

View Source
const FeatureSubIssues = "sub_issues"

FeatureSubIssues is the GitHub API preview header for sub-issues

Variables

View Source
var (
	ErrNotAuthenticated = errors.New("not authenticated - run 'gh auth login' first")
	ErrNotFound         = errors.New("resource not found")
	ErrRateLimited      = errors.New("API rate limit exceeded")
)

Common errors

View Source
var DefaultRetryDelays = []time.Duration{
	1 * time.Second,
	2 * time.Second,
	4 * time.Second,
	8 * time.Second,
}

DefaultRetryDelays defines the exponential backoff delays for retry attempts

Functions

func GetRetryAfter added in v1.0.2

func GetRetryAfter(err error) time.Duration

GetRetryAfter extracts a Retry-After duration from an error, if available. Returns 0 if no Retry-After information is present.

func IsAuthError

func IsAuthError(err error) bool

IsAuthError checks if an error indicates authentication issues

func IsNotFound

func IsNotFound(err error) bool

IsNotFound checks if an error indicates a resource was not found

func IsRateLimited

func IsRateLimited(err error) bool

IsRateLimited checks if an error indicates rate limiting. Detects rate limits via:

  • Sentinel ErrRateLimited
  • HTTP 429 status code (any 429 is a rate limit)
  • HTTP 403 with rate-limit messaging (GitHub secondary rate limits)
  • Error message containing "rate limit" or "RATE_LIMITED"

Non-rate-limit 403 errors (e.g., permission denied) are NOT retried.

func SetTestAuthToken added in v0.8.5

func SetTestAuthToken(token string)

SetTestAuthToken sets a custom auth token for testing purposes. Call with empty string to clear the test token.

func SetTestTransport added in v0.8.5

func SetTestTransport(t http.RoundTripper)

SetTestTransport sets a custom transport for testing purposes. Call with nil to clear the test transport.

func WithRetry added in v0.11.1

func WithRetry(fn func() error, maxRetries int) error

WithRetry executes a function with automatic retry on rate limit errors. Uses exponential backoff: 1s, 2s, 4s, 8s delays. Returns the function's error if not rate limited, or after max retries exceeded.

func WithRetryDelays added in v0.11.1

func WithRetryDelays(fn func() error, maxRetries int, delays []time.Duration) error

WithRetryDelays executes a function with automatic retry using custom delays. This variant is primarily for testing to allow faster tests. If the error carries a Retry-After header, that value overrides the default delay.

func WrapError

func WrapError(operation, resource string, err error) error

WrapError wraps an API error with operation context

Types

type APIError

type APIError struct {
	Operation string
	Resource  string
	Err       error
}

APIError wraps GitHub API errors with additional context

func (*APIError) Error

func (e *APIError) Error() string

func (*APIError) Unwrap

func (e *APIError) Unwrap() error

type Actor

type Actor struct {
	Login string
}

Actor represents a GitHub user or bot

type AddCommentInput added in v0.10.1

type AddCommentInput struct {
	SubjectID graphql.ID     `json:"subjectId"`
	Body      graphql.String `json:"body"`
}

AddCommentInput represents the input for adding a comment

type AddProjectV2ItemByIdInput

type AddProjectV2ItemByIdInput struct {
	ProjectID graphql.ID `json:"projectId"`
	ContentID graphql.ID `json:"contentId"`
}

AddProjectV2ItemByIdInput represents the input for adding an item to a project

type AddSubIssueInput

type AddSubIssueInput struct {
	IssueID    graphql.ID `json:"issueId"`
	SubIssueID graphql.ID `json:"subIssueId"`
}

AddSubIssueInput represents the input for adding a sub-issue

type BatchUpdateResult added in v0.12.0

type BatchUpdateResult struct {
	ItemID    string
	FieldName string
	Success   bool
	Error     string
}

BatchUpdateResult represents the result of a single update in a batch

type BoardItem added in v0.12.0

type BoardItem struct {
	Number     int
	Title      string
	State      string // Issue state: "OPEN" or "CLOSED"
	Status     string
	Priority   string
	Repository string // "owner/repo" format for filtering
}

BoardItem represents a minimal project item for board display. Contains only the fields needed for the board view to minimize API data transfer.

type BoardItemsFilter added in v0.12.0

type BoardItemsFilter struct {
	Repository string  // Filter by repository (owner/repo format)
	State      *string // Filter by issue state: "OPEN", "CLOSED", or nil for all
}

BoardItemsFilter allows filtering board items

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps the GitHub GraphQL API client with project management features

func NewClient

func NewClient() *Client

NewClient creates a new API client with default options

func NewClientWithGraphQL

func NewClientWithGraphQL(gql GraphQLClient) *Client

NewClientWithGraphQL creates a Client with a custom GraphQL client (for testing)

func NewClientWithOptions

func NewClientWithOptions(opts ClientOptions) *Client

NewClientWithOptions creates a new API client with custom options

func (*Client) AddIssueComment added in v0.10.1

func (c *Client) AddIssueComment(issueID, body string) (*Comment, error)

AddIssueComment adds a comment to an issue

func (*Client) AddIssueToProject

func (c *Client) AddIssueToProject(projectID, issueID string) (string, error)

AddIssueToProject adds an issue to a GitHub Project V2

func (*Client) AddLabelToIssue

func (c *Client) AddLabelToIssue(owner, repo, issueID, labelName string) error

AddLabelToIssue adds a label to an issue. If the label doesn't exist in the repository, it will be created automatically.

func (*Client) AddSubIssue

func (c *Client) AddSubIssue(parentIssueID, childIssueID string) error

AddSubIssue links a child issue as a sub-issue of a parent issue

func (*Client) BatchUpdateProjectItemFields added in v0.12.0

func (c *Client) BatchUpdateProjectItemFields(projectID string, updates []FieldUpdate, fields []ProjectField) ([]BatchUpdateResult, error)

BatchUpdateProjectItemFields executes multiple field updates in a single GraphQL mutation. This reduces API calls from O(N) to O(N/batchSize) where batchSize is 50. Returns results for each update indicating success or failure.

func (*Client) CloseIssue added in v0.6.0

func (c *Client) CloseIssue(issueID string) error

CloseIssue closes an issue by its ID

func (*Client) CopyProjectFromTemplate added in v0.14.0

func (c *Client) CopyProjectFromTemplate(ownerID, sourceProjectID, title string) (*Project, error)

CopyProjectFromTemplate creates a new project by copying from a template project. ownerID is the node ID of the owner (user or organization) sourceProjectID is the node ID of the template project to copy from title is the title for the new project

func (*Client) CreateIssue

func (c *Client) CreateIssue(owner, repo, title, body string, labels []string) (*Issue, error)

CreateIssue creates a new issue in a repository

func (*Client) CreateIssueWithOptions

func (c *Client) CreateIssueWithOptions(owner, repo, title, body string, labels, assignees []string, milestone string) (*Issue, error)

CreateIssueWithOptions creates an issue with extended options

func (*Client) CreateLabel added in v0.7.0

func (c *Client) CreateLabel(owner, repo, name, color, description string) error

CreateLabel creates a new label in a repository

func (*Client) CreateProjectField added in v0.5.0

func (c *Client) CreateProjectField(projectID, name, dataType string, singleSelectOptions []string) (*ProjectField, error)

CreateProjectField creates a new field in a GitHub project. Supported field types: TEXT, NUMBER, DATE, SINGLE_SELECT, ITERATION

func (*Client) DeleteLabel added in v0.11.0

func (c *Client) DeleteLabel(owner, repo, labelName string) error

DeleteLabel deletes a label from a repository

func (*Client) DeleteProjectField added in v0.14.0

func (c *Client) DeleteProjectField(fieldID string) error

DeleteProjectField deletes a field from a GitHub project. Note: Built-in fields (Title, Assignees, etc.) cannot be deleted.

func (*Client) EnsureLabelExists added in v0.12.0

func (c *Client) EnsureLabelExists(owner, repo, labelName string) (string, error)

EnsureLabelExists checks if a label exists and creates it if not. Returns the label ID. Only creates labels that are defined in the standard defaults. Returns an error for non-standard labels.

func (*Client) FieldExists added in v0.7.0

func (c *Client) FieldExists(projectID, fieldName string) (bool, error)

FieldExists checks if a field exists in a project by name

func (*Client) GetAuthenticatedUser added in v0.6.0

func (c *Client) GetAuthenticatedUser() (string, error)

GetAuthenticatedUser returns the login of the currently authenticated user

func (*Client) GetClosedIssuesByLabel added in v0.6.0

func (c *Client) GetClosedIssuesByLabel(owner, repo, label string) ([]Issue, error)

GetClosedIssuesByLabel fetches closed issues with a specific label

func (*Client) GetIssue

func (c *Client) GetIssue(owner, repo string, number int) (*Issue, error)

GetIssue fetches an issue by repository and number

func (*Client) GetIssueByNumber added in v0.6.0

func (c *Client) GetIssueByNumber(owner, repo string, number int) (*Issue, error)

GetIssueByNumber returns an issue by its number (alias for GetIssue)

func (*Client) GetIssueComments

func (c *Client) GetIssueComments(owner, repo string, number int) ([]Comment, error)

GetIssueComments fetches comments for an issue

func (*Client) GetIssueWithProjectFields added in v0.8.2

func (c *Client) GetIssueWithProjectFields(owner, repo string, number int) (*Issue, []FieldValue, error)

GetIssueWithProjectFields fetches an issue and its project field values in a single query. This is more efficient than calling GetIssue + GetProjectItems when you only need one issue.

func (*Client) GetIssuesWithProjectFieldsBatch added in v1.1.0

func (c *Client) GetIssuesWithProjectFieldsBatch(owner, repo string, numbers []int) (map[int]*Issue, map[int][]FieldValue, map[int]error, error)

GetIssuesWithProjectFieldsBatch fetches multiple issues with full detail (including author, milestone, labels, assignees) and project field values in a single GraphQL query. Optimized for the view command's batch mode.

func (*Client) GetLatestGitTag added in v0.7.0

func (c *Client) GetLatestGitTag() (string, error)

GetLatestGitTag returns the latest git tag using git describe

func (*Client) GetOpenIssuesByLabel added in v0.6.0

func (c *Client) GetOpenIssuesByLabel(owner, repo, label string) ([]Issue, error)

GetOpenIssuesByLabel fetches open issues with a specific label

func (*Client) GetOwnerID added in v0.14.0

func (c *Client) GetOwnerID(owner string) (string, error)

GetOwnerID returns the node ID for a user or organization.

func (*Client) GetParentIssue

func (c *Client) GetParentIssue(owner, repo string, number int) (*Issue, error)

GetParentIssue fetches the parent issue for a given sub-issue

func (*Client) GetParentIssueBatch added in v1.1.0

func (c *Client) GetParentIssueBatch(owner, repo string, numbers []int) (map[int]*Issue, error)

GetParentIssueBatch fetches parent issues for multiple issues in a single query. Returns a map from child issue number to parent *Issue (nil if no parent).

func (*Client) GetProject

func (c *Client) GetProject(owner string, number int) (*Project, error)

GetProject fetches a project by owner and number

func (*Client) GetProjectFields

func (c *Client) GetProjectFields(projectID string) ([]ProjectField, error)

GetProjectFields fetches all fields for a project. Uses cursor-based pagination to retrieve all fields regardless of project size.

func (*Client) GetProjectFieldsForIssues added in v0.12.0

func (c *Client) GetProjectFieldsForIssues(projectID string, issueIDs []string) (map[string][]FieldValue, error)

GetProjectFieldsForIssues fetches project field values for multiple issues in batched queries. Returns a map from issue node ID to its field values. Uses batching to avoid query size limits.

func (*Client) GetProjectItemFieldValue added in v0.6.0

func (c *Client) GetProjectItemFieldValue(projectID, itemID, fieldName string) (string, error)

GetProjectItemFieldValue returns the value of a field on a project item

func (*Client) GetProjectItemID added in v0.6.0

func (c *Client) GetProjectItemID(projectID, issueID string) (string, error)

GetProjectItemID returns the project item ID for an issue in a project

func (*Client) GetProjectItemIDForIssue added in v0.8.3

func (c *Client) GetProjectItemIDForIssue(projectID, owner, repo string, number int) (string, error)

GetProjectItemIDForIssue looks up the project item ID for a specific issue in a project. This is more efficient than fetching all project items when you only need one.

func (*Client) GetProjectItems

func (c *Client) GetProjectItems(projectID string, filter *ProjectItemsFilter) ([]ProjectItem, error)

GetProjectItems fetches all items from a project with their field values. Uses cursor-based pagination to retrieve all items regardless of project size. If filter.Limit > 0, pagination terminates early once the limit is reached.

func (*Client) GetProjectItemsByIssues added in v0.12.0

func (c *Client) GetProjectItemsByIssues(projectID string, refs []IssueRef) ([]ProjectItem, error)

GetProjectItemsByIssues fetches project items for specific issues using a targeted query. This is more efficient than GetProjectItems when you know which issues you need, as it only fetches the specified issues rather than the entire project. Returns items only for issues that exist in the specified project.

func (*Client) GetProjectItemsForBoard added in v0.12.0

func (c *Client) GetProjectItemsForBoard(projectID string, filter *BoardItemsFilter) ([]BoardItem, error)

GetProjectItemsForBoard fetches minimal project item data optimized for board display. Only retrieves: Number, Title, Status, Priority, and Repository. Uses cursor-based pagination to retrieve all items regardless of project size.

func (*Client) GetProjectItemsMinimal added in v0.13.5

func (c *Client) GetProjectItemsMinimal(projectID string, filter *ProjectItemsFilter) ([]MinimalProjectItem, error)

GetProjectItemsMinimal fetches project items with minimal issue data. This is optimized for filtering by field values (like Branch) without fetching full issue details (Body, Title, Assignees, Labels) which can be large. Use this for two-phase queries: first filter with minimal data, then fetch full details for matching items only.

func (*Client) GetRepositoryID added in v0.14.0

func (c *Client) GetRepositoryID(owner, repo string) (string, error)

GetRepositoryID returns the node ID for a repository.

func (*Client) GetRepositoryIssues

func (c *Client) GetRepositoryIssues(owner, repo, state string) ([]Issue, error)

GetRepositoryIssues fetches issues from a repository with the given state filter

func (*Client) GetSubIssueCounts added in v0.8.3

func (c *Client) GetSubIssueCounts(owner, repo string, numbers []int) (map[int]int, error)

GetSubIssueCounts fetches sub-issue counts for multiple issues in a single query. This is more efficient than calling GetSubIssues for each issue individually. Returns a map of issue number to sub-issue count.

func (*Client) GetSubIssues

func (c *Client) GetSubIssues(owner, repo string, number int) ([]SubIssue, error)

GetSubIssues fetches all sub-issues for a given issue with pagination support

func (*Client) GetSubIssuesBatch added in v0.12.0

func (c *Client) GetSubIssuesBatch(owner, repo string, numbers []int) (map[int][]SubIssue, error)

GetSubIssuesBatch fetches sub-issues for multiple parent issues in a single query. All parent issues must be from the same repository. Returns a map of parent issue number to their sub-issues. This is more efficient than calling GetSubIssues for each parent individually, reducing API calls from O(N) to O(1) per batch.

func (*Client) GitAdd added in v0.6.0

func (c *Client) GitAdd(paths ...string) error

GitAdd stages files to git

func (*Client) GitCheckoutNewBranch added in v0.7.5

func (c *Client) GitCheckoutNewBranch(branch string) error

GitCheckoutNewBranch creates and checks out a new git branch

func (*Client) GitCommit added in v0.6.0

func (c *Client) GitCommit(message string) error

GitCommit creates a git commit with the given message

func (*Client) GitTag added in v0.6.0

func (c *Client) GitTag(tag, message string) error

GitTag creates an annotated git tag

func (*Client) LabelExists added in v0.7.0

func (c *Client) LabelExists(owner, repo, labelName string) (bool, error)

LabelExists checks if a label exists in a repository

func (*Client) LinkProjectToRepository added in v0.14.0

func (c *Client) LinkProjectToRepository(projectID, repositoryID string) error

LinkProjectToRepository adds a repository to a project's linked repositories.

func (*Client) ListProjects

func (c *Client) ListProjects(owner string) ([]Project, error)

ListProjects fetches all projects for an owner (user or organization)

func (*Client) MkdirAll added in v0.6.0

func (c *Client) MkdirAll(path string) error

MkdirAll creates a directory and all parents

func (*Client) RemoveLabelFromIssue added in v0.11.1

func (c *Client) RemoveLabelFromIssue(owner, repo, issueID, labelName string) error

RemoveLabelFromIssue removes a label from an issue

func (*Client) RemoveSubIssue

func (c *Client) RemoveSubIssue(parentIssueID, childIssueID string) error

RemoveSubIssue removes a child issue from its parent issue

func (*Client) ReopenIssue added in v0.8.0

func (c *Client) ReopenIssue(issueID string) error

ReopenIssue reopens a closed issue

func (*Client) SearchRepositoryIssues added in v0.12.0

func (c *Client) SearchRepositoryIssues(owner, repo string, filters SearchFilters, limit int) ([]Issue, error)

SearchRepositoryIssues searches for issues in a repository using GitHub Search API. This is more efficient than fetching all issues when filtering by state, labels, or text. The limit parameter controls maximum results (0 = no limit, uses pagination).

func (*Client) SetProjectItemField

func (c *Client) SetProjectItemField(projectID, itemID, fieldName, value string) error

SetProjectItemField sets a field value on a project item. This method fetches project fields on each call. For bulk operations, use SetProjectItemFieldWithFields with pre-fetched fields for better performance.

func (*Client) SetProjectItemFieldWithFields added in v0.9.2

func (c *Client) SetProjectItemFieldWithFields(projectID, itemID, fieldName, value string, fields []ProjectField) error

SetProjectItemFieldWithFields sets a field value using pre-fetched project fields. Use this method for bulk operations to avoid redundant GetProjectFields API calls.

func (*Client) UpdateIssueBody added in v0.6.0

func (c *Client) UpdateIssueBody(issueID, body string) error

UpdateIssueBody updates the body of an issue

func (*Client) UpdateIssueTitle added in v0.9.7

func (c *Client) UpdateIssueTitle(issueID, title string) error

UpdateIssueTitle updates the title of an issue

func (*Client) UpdateLabel added in v0.11.0

func (c *Client) UpdateLabel(owner, repo, labelName, newName, newColor, newDescription string) error

UpdateLabel updates a label's properties in a repository

func (*Client) WriteFile added in v0.6.0

func (c *Client) WriteFile(path, content string) error

WriteFile writes content to a file path

type ClientOptions

type ClientOptions struct {
	// Host is the GitHub hostname (default: github.com)
	Host string

	// EnableSubIssues enables the sub_issues feature preview
	EnableSubIssues bool

	// EnableIssueTypes enables the issue_types feature preview
	EnableIssueTypes bool

	// Transport specifies the HTTP transport for API requests (for testing)
	Transport http.RoundTripper

	// AuthToken is the authorization token (for testing)
	AuthToken string
}

ClientOptions configures the API client

type CloseIssueInput added in v0.8.6

type CloseIssueInput struct {
	IssueID graphql.ID `json:"issueId"`
}

CloseIssueInput represents the input for closing an issue

type Comment

type Comment struct {
	ID         string
	DatabaseId int
	Author     string
	Body       string
	CreatedAt  string
}

Comment represents an issue comment

type CopyProjectV2Input added in v1.0.3

type CopyProjectV2Input struct {
	OwnerId            graphql.ID      `json:"ownerId"`
	ProjectId          graphql.ID      `json:"projectId"`
	Title              graphql.String  `json:"title"`
	IncludeDraftIssues graphql.Boolean `json:"includeDraftIssues"`
}

CopyProjectV2Input represents the input for copying a project.

type CreateIssueInput

type CreateIssueInput struct {
	RepositoryID graphql.ID     `json:"repositoryId"`
	Title        graphql.String `json:"title"`
	Body         graphql.String `json:"body,omitempty"`
	LabelIDs     *[]graphql.ID  `json:"labelIds,omitempty"`
	AssigneeIDs  *[]graphql.ID  `json:"assigneeIds,omitempty"`
	MilestoneID  *graphql.ID    `json:"milestoneId,omitempty"`
}

CreateIssueInput represents the input for creating an issue

type CreateLabelInput added in v0.7.0

type CreateLabelInput struct {
	RepositoryID graphql.ID     `json:"repositoryId"`
	Name         graphql.String `json:"name"`
	Color        graphql.String `json:"color"`
	Description  graphql.String `json:"description,omitempty"`
}

CreateLabelInput represents the input for creating a label

type CreateProjectV2FieldInput added in v0.5.0

type CreateProjectV2FieldInput struct {
	ProjectID           graphql.ID                               `json:"projectId"`
	DataType            graphql.String                           `json:"dataType"`
	Name                graphql.String                           `json:"name"`
	SingleSelectOptions *[]ProjectV2SingleSelectFieldOptionInput `json:"singleSelectOptions,omitempty"`
}

CreateProjectV2FieldInput represents the input for creating a project field

type DeleteLabelInput added in v0.11.0

type DeleteLabelInput struct {
	ID graphql.ID `json:"id"`
}

DeleteLabelInput represents the input for deleting a label

type DeleteProjectV2FieldInput added in v0.14.1

type DeleteProjectV2FieldInput struct {
	FieldID graphql.ID `json:"fieldId"`
}

DeleteProjectV2FieldInput represents the input for deleting a project field

type FieldOption

type FieldOption struct {
	ID    string
	Name  string
	Color string
}

FieldOption represents an option for a single-select field

type FieldUpdate added in v0.12.0

type FieldUpdate struct {
	ItemID    string // Project item ID
	FieldName string // Field name (e.g., "Status", "Priority")
	Value     string // Display value (e.g., "In Progress", "P1")
	// contains filtered or unexported fields
}

FieldUpdate represents a single field update for batch operations

type FieldValue

type FieldValue struct {
	Field string // Field name
	Value string // Resolved value
}

FieldValue represents a field value on a project item

type GraphQLClient

type GraphQLClient interface {
	Query(name string, query interface{}, variables map[string]interface{}) error
	Mutate(name string, mutation interface{}, variables map[string]interface{}) error
}

GraphQLClient interface allows mocking the GitHub GraphQL client for testing

type Issue

type Issue struct {
	ID         string
	Number     int
	Title      string
	Body       string
	State      string
	URL        string
	Repository Repository
	Author     Actor
	Assignees  []Actor
	Labels     []Label
	Milestone  *Milestone
}

Issue represents a GitHub issue

type IssueRef added in v0.12.0

type IssueRef struct {
	Owner  string
	Repo   string
	Number int
}

IssueRef represents a reference to a GitHub issue by owner/repo/number. Used for targeted queries that fetch specific issues instead of all project items.

type IssueState added in v0.8.5

type IssueState string

IssueState represents GitHub issue state enum for GraphQL queries

const (
	IssueStateOpen   IssueState = "OPEN"
	IssueStateClosed IssueState = "CLOSED"
)

type Label

type Label struct {
	Name  string
	Color string
}

Label represents a GitHub label

type Milestone

type Milestone struct {
	Title string
}

Milestone represents a GitHub milestone

type MinimalProjectItem added in v0.13.5

type MinimalProjectItem struct {
	IssueID     string       // GitHub node ID for API operations
	IssueNumber int          // Issue number for display and IssueRef
	IssueState  string       // "OPEN" or "CLOSED" for filtering
	Repository  string       // "owner/repo" format
	FieldValues []FieldValue // Project field values for filtering
}

MinimalProjectItem represents a project item with minimal issue data. Used for two-phase queries: first fetch minimal data for filtering, then fetch full details only for matching items. This avoids fetching Title, Body, Assignees, Labels for non-matching items.

type Project

type Project struct {
	ID     string
	Number int
	Title  string
	URL    string
	Owner  ProjectOwner
	Closed bool
}

Project represents a GitHub Projects v2 project

type ProjectField

type ProjectField struct {
	ID       string
	Name     string
	DataType string
	Options  []FieldOption // For SINGLE_SELECT fields
}

ProjectField represents a field in a GitHub project

type ProjectItem

type ProjectItem struct {
	ID          string
	Issue       *Issue
	FieldValues []FieldValue
}

ProjectItem represents an issue or PR within a project

type ProjectItemsFilter

type ProjectItemsFilter struct {
	Repository string  // Filter by repository (owner/repo format)
	State      *string // Filter by issue state: "OPEN", "CLOSED", or nil for all
	Limit      int     // Maximum number of items to return (0 = no limit)
}

ProjectItemsFilter allows filtering project items

type ProjectOwner

type ProjectOwner struct {
	Type  string // "User" or "Organization"
	Login string
}

ProjectOwner represents the owner of a project

type ProjectV2FieldValue

type ProjectV2FieldValue struct {
	Text                 graphql.String `json:"text,omitempty"`
	Number               graphql.Float  `json:"number,omitempty"`
	Date                 graphql.String `json:"date,omitempty"`
	SingleSelectOptionId graphql.String `json:"singleSelectOptionId,omitempty"`
	IterationId          graphql.String `json:"iterationId,omitempty"`
}

ProjectV2FieldValue represents a field value for a project item

type ProjectV2SingleSelectFieldOptionInput added in v0.5.0

type ProjectV2SingleSelectFieldOptionInput struct {
	Name        graphql.String `json:"name"`
	Color       graphql.String `json:"color,omitempty"`
	Description graphql.String `json:"description,omitempty"`
}

ProjectV2SingleSelectFieldOptionInput represents an option for a single select field

type RemoveSubIssueInput

type RemoveSubIssueInput struct {
	IssueID    graphql.ID `json:"issueId"`
	SubIssueID graphql.ID `json:"subIssueId"`
}

RemoveSubIssueInput represents the input for removing a sub-issue

type ReopenIssueInput added in v0.8.6

type ReopenIssueInput struct {
	IssueID graphql.ID `json:"issueId"`
}

ReopenIssueInput represents the input for reopening an issue

type Repository

type Repository struct {
	Owner string
	Name  string
}

Repository represents a GitHub repository

type SearchFilters added in v0.12.0

type SearchFilters struct {
	State    string   // "open", "closed", or "all"
	Labels   []string // Filter by label names
	Assignee string   // Filter by assignee login
	Search   string   // Free-text search in title/body
}

SearchFilters contains filters for searching repository issues

type SubIssue

type SubIssue struct {
	ID         string
	Number     int
	Title      string
	State      string
	URL        string
	ParentID   string
	Repository Repository // Repository where the sub-issue lives
}

SubIssue represents a sub-issue relationship

type UpdateIssueInput added in v0.8.6

type UpdateIssueInput struct {
	ID    graphql.ID     `json:"id"`
	Body  graphql.String `json:"body,omitempty"`
	Title graphql.String `json:"title,omitempty"`
}

UpdateIssueInput represents the input for updating an issue

type UpdateLabelInput added in v0.11.0

type UpdateLabelInput struct {
	ID          graphql.ID     `json:"id"`
	Name        graphql.String `json:"name,omitempty"`
	Color       graphql.String `json:"color,omitempty"`
	Description graphql.String `json:"description,omitempty"`
}

UpdateLabelInput represents the input for updating a label

type UpdateProjectV2ItemFieldValueInput

type UpdateProjectV2ItemFieldValueInput struct {
	ProjectID graphql.ID          `json:"projectId"`
	ItemID    graphql.ID          `json:"itemId"`
	FieldID   graphql.ID          `json:"fieldId"`
	Value     ProjectV2FieldValue `json:"value"`
}

UpdateProjectV2ItemFieldValueInput represents the input for updating a field value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL