traph_go

package module
v0.0.0-...-dcd3a03 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2019 License: MIT Imports: 10 Imported by: 0

README

traph-go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

Types

type CloseIssue

type CloseIssue struct {
	ID     string `json:"id"`
	Status bool   `json:"status"`
}

type Comment

type Comment struct {
	ID      string `json:"id"`
	IssueID string `json:"issueId"`
	UserID  string `json:"userId"`
	Text    string `json:"text"`
}

type ComplexityRoot

type ComplexityRoot struct {
	Comment struct {
		ID      func(childComplexity int) int
		IssueID func(childComplexity int) int
		Text    func(childComplexity int) int
		UserID  func(childComplexity int) int
	}

	Issue struct {
		Comments  func(childComplexity int) int
		ID        func(childComplexity int) int
		Name      func(childComplexity int) int
		ProjectID func(childComplexity int) int
		Status    func(childComplexity int) int
	}

	Mutation struct {
		CloseIssue    func(childComplexity int, input CloseIssue) int
		CreateComment func(childComplexity int, input NewComment) int
		CreateIssue   func(childComplexity int, input NewIssue) int
		CreateProject func(childComplexity int, input NewProject) int
		CreateUser    func(childComplexity int, input NewUser) int
		DeleteUser    func(childComplexity int, input DeleteUser) int
		UpdateComment func(childComplexity int, input NewComment) int
		UpdateProject func(childComplexity int, input EditedProject) int
		UpdateUser    func(childComplexity int, input EditedUser) int
	}

	MutationResult struct {
		StatusCode    func(childComplexity int) int
		StatusMessage func(childComplexity int) int
	}

	Project struct {
		Description func(childComplexity int) int
		ID          func(childComplexity int) int
		Issues      func(childComplexity int) int
		Name        func(childComplexity int) int
	}

	Query struct {
		Project  func(childComplexity int, id string) int
		Projects func(childComplexity int) int
	}

	User struct {
		DisplayName func(childComplexity int) int
		Email       func(childComplexity int) int
		ID          func(childComplexity int) int
		Name        func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DeleteUser

type DeleteUser struct {
	ID string `json:"id"`
}

type DirectiveRoot

type DirectiveRoot struct {
}

type EditedProject

type EditedProject struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type EditedUser

type EditedUser struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
	Email       string `json:"email"`
}

type Issue

type Issue struct {
	ID        string     `json:"id"`
	ProjectID string     `json:"projectId"`
	Name      string     `json:"name"`
	Status    bool       `json:"status"`
	Comments  []*Comment `json:"comments"`
}

type MutationResolver

type MutationResolver interface {
	CreateUser(ctx context.Context, input NewUser) (*User, error)
	UpdateUser(ctx context.Context, input EditedUser) (*User, error)
	DeleteUser(ctx context.Context, input DeleteUser) (*MutationResult, error)
	CreateProject(ctx context.Context, input NewProject) (*Project, error)
	UpdateProject(ctx context.Context, input EditedProject) (*Project, error)
	CreateIssue(ctx context.Context, input NewIssue) (*Issue, error)
	CloseIssue(ctx context.Context, input CloseIssue) (*Issue, error)
	CreateComment(ctx context.Context, input NewComment) ([]*Comment, error)
	UpdateComment(ctx context.Context, input NewComment) ([]*Comment, error)
}

type MutationResult

type MutationResult struct {
	StatusCode    string `json:"statusCode"`
	StatusMessage string `json:"statusMessage"`
}

type NewComment

type NewComment struct {
	IssueID string `json:"issueId"`
	UserID  string `json:"userId"`
	Text    string `json:"text"`
}

type NewIssue

type NewIssue struct {
	ProjectID string `json:"projectId"`
	Name      string `json:"name"`
}

type NewProject

type NewProject struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

type NewUser

type NewUser struct {
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
	Email       string `json:"email"`
}

type Project

type Project struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Issues      []*Issue `json:"issues"`
}

type QueryResolver

type QueryResolver interface {
	Projects(ctx context.Context) ([]*Project, error)
	Project(ctx context.Context, id string) (*Project, error)
}

type Resolver

type Resolver struct{}

func (*Resolver) Mutation

func (r *Resolver) Mutation() MutationResolver

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

type ResolverRoot

type ResolverRoot interface {
	Mutation() MutationResolver
	Query() QueryResolver
}

type User

type User struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
	Email       string `json:"email"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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