graph

package
v0.0.0-...-3321fbd Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: GPL-3.0 Imports: 16 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 {
	Global struct {
		Currency func(childComplexity int) int
		Vat      func(childComplexity int) int
	}

	LoginSuccess struct {
		Message func(childComplexity int) int
		Success func(childComplexity int) int
		User    func(childComplexity int) int
	}

	Mutation struct {
		Category func(childComplexity int, id *string, name *string) int
		Login    func(childComplexity int, credentials *model.Login) int
		Logout   func(childComplexity int) int
		Product  func(childComplexity int, id *string, product *model.ProductInput) int
		Register func(childComplexity int, accountData *model.UserRegistration) int
	}

	Product struct {
		Category   func(childComplexity int) int
		CreatedAt  func(childComplexity int) int
		ID         func(childComplexity int) int
		Name       func(childComplexity int) int
		Price      func(childComplexity int) int
		Properties func(childComplexity int) int
	}

	ProductCreationSuccess struct {
		Message func(childComplexity int) int
		Product func(childComplexity int) int
		Success func(childComplexity int) int
	}

	ProductProperty struct {
		ID    func(childComplexity int) int
		Name  func(childComplexity int) int
		Value func(childComplexity int) int
	}

	Query struct {
		Category func(childComplexity int) int
		Global   func(childComplexity int) int
		Product  func(childComplexity int, category *string) int
	}

	RegistrationSuccess struct {
		Message func(childComplexity int) int
		Success func(childComplexity int) int
	}

	Success struct {
		Message func(childComplexity int) int
		Success func(childComplexity int) int
	}

	User struct {
		FirstName func(childComplexity int) int
		LastName  func(childComplexity int) int
		Mail      func(childComplexity int) int
		Phone     func(childComplexity int) int
		Username  func(childComplexity int) int
	}
}

type Config

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

type DirectiveRoot

type DirectiveRoot struct {
	HasRole func(ctx context.Context, obj interface{}, next graphql.Resolver, role model.Role) (res interface{}, err error)
}

type MutationResolver

type MutationResolver interface {
	Login(ctx context.Context, credentials *model.Login) (*model.LoginSuccess, error)
	Register(ctx context.Context, accountData *model.UserRegistration) (*model.RegistrationSuccess, error)
	Logout(ctx context.Context) (*model.Success, error)
	Category(ctx context.Context, id *string, name *string) (*model.Success, error)
	Product(ctx context.Context, id *string, product *model.ProductInput) (*model.ProductCreationSuccess, error)
}

type QueryResolver

type QueryResolver interface {
	Category(ctx context.Context) ([]*string, error)
	Product(ctx context.Context, category *string) ([]*model.Product, error)
	Global(ctx context.Context) (*model.Global, 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
resolver

Jump to

Keyboard shortcuts

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