graph

package
v0.0.0-...-cabdf00 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MIT Imports: 14 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 CategoryResolver

type CategoryResolver interface {
	Courses(ctx context.Context, obj *model.Category) ([]*model.Course, error)
}

type ComplexityRoot

type ComplexityRoot struct {
	Category struct {
		Courses     func(childComplexity int) int
		Description func(childComplexity int) int
		ID          func(childComplexity int) int
		Name        func(childComplexity int) int
	}

	Course struct {
		Category    func(childComplexity int) int
		Description func(childComplexity int) int
		ID          func(childComplexity int) int
		Name        func(childComplexity int) int
	}

	Mutation struct {
		CreateCategory func(childComplexity int, input model.NewCategory) int
		CreateCourse   func(childComplexity int, input model.NewCourse) int
	}

	Query struct {
		Categories func(childComplexity int) int
		Courses    func(childComplexity int) int
	}
}

type Config

type Config struct {
	Schema     *ast.Schema
	Resolvers  ResolverRoot
	Directives DirectiveRoot
	Complexity ComplexityRoot
}

type CourseResolver

type CourseResolver interface {
	Category(ctx context.Context, obj *model.Course) (*model.Category, error)
}

type DirectiveRoot

type DirectiveRoot struct {
}

type MutationResolver

type MutationResolver interface {
	CreateCategory(ctx context.Context, input model.NewCategory) (*model.Category, error)
	CreateCourse(ctx context.Context, input model.NewCourse) (*model.Course, error)
}

type QueryResolver

type QueryResolver interface {
	Categories(ctx context.Context) ([]*model.Category, error)
	Courses(ctx context.Context) ([]*model.Course, error)
}

type Resolver

type Resolver struct {
	CategoryDB *database.Category
	CourseDB   *database.Course
}

This file will not be regenerated automatically.

It serves as dependency injection for your app, add any dependencies you require here. Injetando as dependecias do meu projeto para poder usar dentro do schema.Resolvers.

func (*Resolver) Category

func (r *Resolver) Category() CategoryResolver

Category returns CategoryResolver implementation.

func (*Resolver) Course

func (r *Resolver) Course() CourseResolver

Course returns CourseResolver implementation.

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 {
	Category() CategoryResolver
	Course() CourseResolver
	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