graph

package
v0.0.0-...-0d2555d Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 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 ComplexityRoot

type ComplexityRoot struct {
	Department struct {
		DepartmentID func(childComplexity int) int
		Name         func(childComplexity int) int
	}

	Employee struct {
		DepartmentID func(childComplexity int) int
		Dob          func(childComplexity int) int
		Email        func(childComplexity int) int
		EmployeeID   func(childComplexity int) int
		FirstName    func(childComplexity int) int
		LastName     func(childComplexity int) int
		Position     func(childComplexity int) int
		Username     func(childComplexity int) int
	}

	Mutation struct {
		CreateEmployee func(childComplexity int, params model.CreateEmployeeParams) int
		DeleteEmployee func(childComplexity int, id string) int
		UpdateEmployee func(childComplexity int, params model.UpdateEmployeeParams) int
	}

	Query struct {
		Employee  func(childComplexity int, id string) int
		Employees func(childComplexity int, limit *int, page *int, sortBy *string) int
	}

	Response struct {
		Msg    func(childComplexity int) int
		Status 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 {
	CreateEmployee(ctx context.Context, params model.CreateEmployeeParams) (*model.Response, error)
	UpdateEmployee(ctx context.Context, params model.UpdateEmployeeParams) (*model.Response, error)
	DeleteEmployee(ctx context.Context, id string) (*model.Response, error)
}

type QueryResolver

type QueryResolver interface {
	Employee(ctx context.Context, id string) (*model.Employee, error)
	Employees(ctx context.Context, limit *int, page *int, sortBy *string) ([]*model.Employee, error)
}

type Resolver

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

func NewResolver

func NewResolver() (*Resolver, error)

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