graph

package
v0.0.0-...-dafb160 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownType  = errors.New("unknown type")
	ErrTypeNotFound = errors.New("type not found")
)

Functions

func NewExecutableSchema

func NewExecutableSchema(cfg Config) graphql.ExecutableSchema

NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.

Types

type ComplexityRoot

type ComplexityRoot struct {
	Article struct {
		Author      func(childComplexity int) int
		ContentData func(childComplexity int) int
		DateWritten func(childComplexity int) int
		Description func(childComplexity int) int
		Tags        func(childComplexity int) int
		Title       func(childComplexity int) int
		TitleCard   func(childComplexity int) int
		URL         func(childComplexity int) int
		UUID        func(childComplexity int) int
	}

	ArticleTag struct {
		Keyword func(childComplexity int) int
	}

	Articles struct {
		Article      func(childComplexity int) int
		Total        func(childComplexity int) int
		ZincPassword func(childComplexity int) int
	}

	Author struct {
		Name     func(childComplexity int) int
		Picture  func(childComplexity int) int
		Profile  func(childComplexity int) int
		Username func(childComplexity int) int
	}

	GalleryImages struct {
		Images func(childComplexity int) int
		Total  func(childComplexity int) int
	}

	Image struct {
		ArticleUUID func(childComplexity int) int
		Name        func(childComplexity int) int
		ProjectUUID func(childComplexity int) int
		Type        func(childComplexity int) int
		URL         func(childComplexity int) int
	}

	LoginData struct {
		Jwt      func(childComplexity int) int
		Role     func(childComplexity int) int
		Username func(childComplexity int) int
	}

	Mutation struct {
		CreateArticle      func(childComplexity int, input *model.CreateArticleInfo) int
		CreateProject      func(childComplexity int, input *model.CreateProjectInput) int
		CreateUser         func(childComplexity int, input *model.UserCreation) int
		DeleteAllArticles  func(childComplexity int, input *model.DeleteAllArticlesInput) int
		DeleteAllUsers     func(childComplexity int, jwt string) int
		DeleteArticle      func(childComplexity int, input *model.DeleteBucketInfo) int
		DeleteProject      func(childComplexity int, input *model.DeleteProjectType) int
		DeleteProjects     func(childComplexity int, input *model.DeleteAllProjects) int
		DeleteUser         func(childComplexity int, input *model.DeleteUser) int
		EditUser           func(childComplexity int, input *model.EditUser) int
		LoginUser          func(childComplexity int, username string, password string) int
		Logout             func(childComplexity int, jwt string) int
		UpdateArticle      func(childComplexity int, input *model.UpdatedArticleInfo) int
		UploadArticleImage func(childComplexity int, input *model.UploadArticleImageInput) int
	}

	Project struct {
		Articles      func(childComplexity int) int
		Author        func(childComplexity int) int
		Description   func(childComplexity int) int
		EncryptionKey func(childComplexity int) int
		Name          func(childComplexity int) int
		UUID          func(childComplexity int) int
	}

	Projects struct {
		Projects func(childComplexity int) int
	}

	Query struct {
		ArticlePrivate   func(childComplexity int, input *model.FindArticlePrivateType) int
		ArticlePublic    func(childComplexity int, input *model.FindArticlePublicType) int
		ArticlesPrivate  func(childComplexity int, input *model.ArticlesPrivate) int
		ArticlesPublic   func(childComplexity int, input *model.GetZincArticleInput) int
		GetGalleryImages func(childComplexity int, jwt string) int
		GetProjects      func(childComplexity int, input *model.GetProjectType) int
		GetUsers         func(childComplexity int, jwt string) int
	}

	Tag struct {
		Tag func(childComplexity int) int
	}

	User struct {
		Bio            func(childComplexity int) int
		Email          func(childComplexity int) int
		HashedPassword func(childComplexity int) int
		Name           func(childComplexity int) int
		ProfileLink    func(childComplexity int) int
		ProfilePicture func(childComplexity int) int
		Projects       func(childComplexity int) int
		Role           func(childComplexity int) int
		UUID           func(childComplexity int) int
		Username       func(childComplexity int) int
	}

	Users struct {
		TotalCount func(childComplexity int) int
		Users      func(childComplexity int) int
	}

	ZincUser struct {
		Password func(childComplexity int) int
		Username func(childComplexity int) int
	}

	Jwt struct {
		Token func(childComplexity int) int
	}
}

type Config

type Config struct {
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type DirectiveRoot

type DirectiveRoot struct {
}

type MutationResolver

type MutationResolver interface {
	CreateArticle(ctx context.Context, input *model.CreateArticleInfo) (*model.Article, error)
	UpdateArticle(ctx context.Context, input *model.UpdatedArticleInfo) (*model.Article, error)
	DeleteArticle(ctx context.Context, input *model.DeleteBucketInfo) (string, error)
	DeleteAllArticles(ctx context.Context, input *model.DeleteAllArticlesInput) (string, error)
	CreateProject(ctx context.Context, input *model.CreateProjectInput) (*model.Project, error)
	CreateUser(ctx context.Context, input *model.UserCreation) (*model.User, error)
	LoginUser(ctx context.Context, username string, password string) (*model.LoginData, error)
	DeleteProject(ctx context.Context, input *model.DeleteProjectType) (string, error)
	DeleteProjects(ctx context.Context, input *model.DeleteAllProjects) (string, error)
	Logout(ctx context.Context, jwt string) (string, error)
	DeleteUser(ctx context.Context, input *model.DeleteUser) (string, error)
	DeleteAllUsers(ctx context.Context, jwt string) (string, error)
	EditUser(ctx context.Context, input *model.EditUser) (string, error)
	UploadArticleImage(ctx context.Context, input *model.UploadArticleImageInput) (string, error)
}

type QueryResolver

type QueryResolver interface {
	ArticlePrivate(ctx context.Context, input *model.FindArticlePrivateType) (*model.Article, error)
	ArticlesPrivate(ctx context.Context, input *model.ArticlesPrivate) (*model.Articles, error)
	ArticlesPublic(ctx context.Context, input *model.GetZincArticleInput) (*model.Articles, error)
	GetGalleryImages(ctx context.Context, jwt string) (*model.GalleryImages, error)
	GetProjects(ctx context.Context, input *model.GetProjectType) (*model.Projects, error)
	ArticlePublic(ctx context.Context, input *model.FindArticlePublicType) (*model.Article, error)
	GetUsers(ctx context.Context, jwt string) (*model.Users, error)
}

type Resolver

type Resolver struct{}

func (*Resolver) Mutation

func (r *Resolver) Mutation() MutationResolver

Mutation returns MutationResolver implementation.

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

Query returns QueryResolver implementation.

type ResolverRoot

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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