graph

package
v0.0.0-...-f7dd486 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 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 {
	Course struct {
		Description   func(childComplexity int) int
		ID            func(childComplexity int) int
		Lessons       func(childComplexity int) int
		Name          func(childComplexity int) int
		Price         func(childComplexity int) int
		Psychologists func(childComplexity int) int
	}

	Lesson struct {
		Course func(childComplexity int) int
		ID     func(childComplexity int) int
		Name   func(childComplexity int) int
		Number func(childComplexity int) int
	}

	Mutation struct {
		CreateCourse       func(childComplexity int, input model.NewCourse) int
		CreateLesson       func(childComplexity int, input model.NewLesson) int
		CreatePsychologist func(childComplexity int, input model.NewPsychologist) int
		UpdateCourse       func(childComplexity int, input model.UpdateCourse) int
		UpdateLesson       func(childComplexity int, input model.UpdateLesson) int
		UpdatePsychologist func(childComplexity int, input model.UpdatePsychologist) int
	}

	Psychologist struct {
		Courses     func(childComplexity int) int
		Description func(childComplexity int) int
		ID          func(childComplexity int) int
		Name        func(childComplexity int) int
	}

	Query struct {
		Course        func(childComplexity int, id string) int
		Courses       func(childComplexity int) int
		Lesson        func(childComplexity int, id string) int
		Lessons       func(childComplexity int) int
		Psychologist  func(childComplexity int, id string) int
		Psychologists func(childComplexity int) int
	}
}

type Config

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

type CourseResolver

type CourseResolver interface {
	Psychologists(ctx context.Context, obj *bunmodels.Course) ([]*bunmodels.Psychologist, error)
	Lessons(ctx context.Context, obj *bunmodels.Course) ([]*bunmodels.Lesson, error)
}

type DirectiveRoot

type DirectiveRoot struct {
}

type LessonResolver

type LessonResolver interface {
	Course(ctx context.Context, obj *bunmodels.Lesson) (*bunmodels.Course, error)
}

type MutationResolver

type MutationResolver interface {
	CreatePsychologist(ctx context.Context, input model.NewPsychologist) (*bunmodels.Psychologist, error)
	UpdatePsychologist(ctx context.Context, input model.UpdatePsychologist) (*bunmodels.Psychologist, error)
	CreateCourse(ctx context.Context, input model.NewCourse) (*bunmodels.Course, error)
	UpdateCourse(ctx context.Context, input model.UpdateCourse) (*bunmodels.Course, error)
	CreateLesson(ctx context.Context, input model.NewLesson) (*bunmodels.Lesson, error)
	UpdateLesson(ctx context.Context, input model.UpdateLesson) (*bunmodels.Lesson, error)
}

type PsychologistResolver

type PsychologistResolver interface {
	Courses(ctx context.Context, obj *bunmodels.Psychologist) ([]*bunmodels.Course, error)
}

type QueryResolver

type QueryResolver interface {
	Psychologist(ctx context.Context, id string) (*bunmodels.Psychologist, error)
	Psychologists(ctx context.Context) ([]*bunmodels.Psychologist, error)
	Course(ctx context.Context, id string) (*bunmodels.Course, error)
	Courses(ctx context.Context) ([]*bunmodels.Course, error)
	Lesson(ctx context.Context, id string) (*bunmodels.Lesson, error)
	Lessons(ctx context.Context) ([]*bunmodels.Lesson, error)
}

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

func NewResolver

func NewResolver(em *entman.EntityManager) *Resolver

func (*Resolver) Course

func (r *Resolver) Course() CourseResolver

func (*Resolver) Lesson

func (r *Resolver) Lesson() LessonResolver

func (*Resolver) Mutation

func (r *Resolver) Mutation() MutationResolver

func (*Resolver) Psychologist

func (r *Resolver) Psychologist() PsychologistResolver

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

type ResolverRoot

type ResolverRoot interface {
	Course() CourseResolver
	Lesson() LessonResolver
	Mutation() MutationResolver
	Psychologist() PsychologistResolver
	Query() QueryResolver
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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