graphql

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package graphql implements Githome's GraphQL API v4. The schema under schema/ is the source of truth; gqlgen generates the executable schema into generated/ and the resolver stubs into this package, which are then filled in by hand.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(root *mizu.Router, d Deps)

Mount registers the GraphQL endpoint at both the GHES-style /api/graphql and the github.com-style /graphql, sharing one handler.

func NewHandler

func NewHandler(d Deps) http.Handler

NewHandler builds the GraphQL HTTP handler: the gqlgen executable schema over the root resolver, the POST and GET transports gh and octokit use, a parsed query cache, and the auth middleware that mirrors the REST surface.

Types

type Deps

type Deps struct {
	Auth       *auth.Service
	Repos      *domain.RepoService
	Issues     *domain.IssueService
	Pulls      *domain.PRService
	Reviews    *domain.ReviewService
	Checks     *domain.ChecksService
	URLs       *presenter.URLBuilder
	NodeFormat nodeid.Format
}

Deps are the dependencies the GraphQL surface needs to mount: the auth service that resolves the request actor, the domain services resolvers fetch through, the presenter that renders the wire shapes, and the node-ID format.

type Resolver

type Resolver struct {
	Repos      *domain.RepoService
	Issues     *domain.IssueService
	Pulls      *domain.PRService
	Reviews    *domain.ReviewService
	Checks     *domain.ChecksService
	URLs       *presenter.URLBuilder
	NodeFormat nodeid.Format
}

Resolver is the GraphQL root resolver. It holds the domain services the resolvers fetch through and the presenter that renders domain values into the gqlmodel wire shapes. Resolvers never touch the store or git directly, the same rule the REST handlers follow.

func (*Resolver) Commit

func (r *Resolver) Commit() generated.CommitResolver

Commit returns generated.CommitResolver implementation.

func (*Resolver) Issue

func (r *Resolver) Issue() generated.IssueResolver

Issue returns generated.IssueResolver implementation.

func (*Resolver) Mutation

func (r *Resolver) Mutation() generated.MutationResolver

Mutation returns generated.MutationResolver implementation.

func (*Resolver) PullRequest

func (r *Resolver) PullRequest() generated.PullRequestResolver

PullRequest returns generated.PullRequestResolver implementation.

func (*Resolver) PullRequestReviewThread

func (r *Resolver) PullRequestReviewThread() generated.PullRequestReviewThreadResolver

PullRequestReviewThread returns generated.PullRequestReviewThreadResolver implementation.

func (*Resolver) Query

func (r *Resolver) Query() generated.QueryResolver

Query returns generated.QueryResolver implementation.

func (*Resolver) Repository

func (r *Resolver) Repository() generated.RepositoryResolver

Repository returns generated.RepositoryResolver implementation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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