graph

package
v0.0.0-...-53e12df Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: MIT Imports: 13 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 {
	DailyRecord struct {
		ClosePrice    func(childComplexity int) int
		Date          func(childComplexity int) int
		HighestPrice  func(childComplexity int) int
		LowestPrice   func(childComplexity int) int
		OpenPrice     func(childComplexity int) int
		PriceDiff     func(childComplexity int) int
		TradingPrice  func(childComplexity int) int
		TradingVolume func(childComplexity int) int
		TransAmount   func(childComplexity int) int
	}

	Mutation struct {
		CreateStock  func(childComplexity int, input model.NewStock) int
		InsertRecord func(childComplexity int, input model.NewRecord) int
	}

	Query struct {
		Stock func(childComplexity int, code string) int
	}

	Stock struct {
		Code             func(childComplexity int) int
		HistoricalRecord func(childComplexity int) int
		Name             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 {
	CreateStock(ctx context.Context, input model.NewStock) (*model.Stock, error)
	InsertRecord(ctx context.Context, input model.NewRecord) (*model.DailyRecord, error)
}

type QueryResolver

type QueryResolver interface {
	Stock(ctx context.Context, code string) (*model.Stock, 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

Jump to

Keyboard shortcuts

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