graph

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: Apache-2.0 Imports: 23 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.

func Setup

func Setup(storage storage.Storage, m *chi.Mux) *chi.Mux

Setup sets up the GraphQL server on the given mux

Types

type ComplexityRoot

type ComplexityRoot struct {
	ExchangeRate struct {
		AsOf      func(childComplexity int) int
		Base      func(childComplexity int) int
		FetchedAt func(childComplexity int) int
		Rate      func(childComplexity int) int
		RateType  func(childComplexity int) int
		Source    func(childComplexity int) int
		Target    func(childComplexity int) int
	}

	ExchangeRatePage struct {
		Results func(childComplexity int) int
		Total   func(childComplexity int) int
	}

	Query struct {
		Currencies func(childComplexity int) int
		Rates      func(childComplexity int, base string, target *string, asOf *model.Time, source *string, typeArg *model.RateType, limit *int32, offset *int32) int
		Sources    func(childComplexity int) int
	}
}

type Config

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

type DirectiveRoot

type DirectiveRoot struct {
}

type QueryResolver

type QueryResolver interface {
	Rates(ctx context.Context, base string, target *string, asOf *model.Time, source *string, typeArg *model.RateType, limit *int32, offset *int32) (*model.ExchangeRatePage, error)
	Sources(ctx context.Context) ([]string, error)
	Currencies(ctx context.Context) ([]string, error)
}

type Resolver

type Resolver struct {
	Storage storage.Storage
}

func NewResolver

func NewResolver(s storage.Storage) *Resolver

func (*Resolver) Query

func (r *Resolver) Query() QueryResolver

Query returns QueryResolver implementation.

type ResolverRoot

type ResolverRoot interface {
	Query() QueryResolver
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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