graph

package
v0.0.0-...-e3d7e6a Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 15 Imported by: 0

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 ComplexityRoot

type ComplexityRoot struct {
	DeleteResult struct {
		Error        func(childComplexity int) int
		IsSuccessful func(childComplexity int) int
	}

	Genre struct {
		ID   func(childComplexity int) int
		Name func(childComplexity int) int
	}

	Mutation struct {
		CreateGenre func(childComplexity int, input model.NewGenre) int
		DeleteGenre func(childComplexity int, id int) int
		UpdateGenre func(childComplexity int, input model.UpdateGenre) int
	}

	Query struct {
		Genre  func(childComplexity int, id int) int
		Genres 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 {
	CreateGenre(ctx context.Context, input model.NewGenre) (*model.Genre, error)
	UpdateGenre(ctx context.Context, input model.UpdateGenre) (*model.Genre, error)
	DeleteGenre(ctx context.Context, id int) (*model.DeleteResult, error)
}

type QueryResolver

type QueryResolver interface {
	Genres(ctx context.Context) ([]*model.Genre, error)
	Genre(ctx context.Context, id int) (*model.Genre, error)
}

type Resolver

type Resolver struct {
	DB persistance.LibraryDb
}

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